/* 
 * Course Page CSS Styles
 * Extracted from courses.php
 */

/* ===== CSS Variables ===== */
:root {
    /* Your custom color scheme */
    --teal-deep: #5fb3b3;      /* สีเขียวเข้ม - บนสุด */
    --mint-medium: #88c999;     /* สีเขียวกลาง */
    --mint-light: #b8e6c1;     /* สีเขียวอ่อน */
    --cream-yellow: #f0e6a6;   /* สีเหลืองครีม - ล่างสุด */

    /* Legacy color scheme for compatibility */
    --primary-green: #5fb3b3;  /* Use teal-deep as primary */
    --light-green: #88c999;    /* Use mint-medium as light */
    --teal: #0891b2;
    --emerald: #059669;
    --green-100: #dcfce7;
    --green-200: #bbf7d0;
    --text-dark: #1f2937;
    --text-medium: #6b7280;
    --text-light: #9ca3af;
}

/* ===== Background Gradients ===== */
/* Custom bg-gradient class using your specified color scheme */
.bg-gradient {
    background: linear-gradient(135deg, 
        var(--teal-deep) 0%,     /* สีเขียวเข้ม - บนสุด */
        var(--mint-medium) 35%,   /* สีเขียวกลาง */
        var(--mint-light) 70%,   /* สีเขียวอ่อน */
        var(--cream-yellow) 100%  /* สีเหลืองครีม - ล่างสุด */
    ) !important;
    color: var(--text-dark) !important;
}

/* Alternative gradient variations */
.bg-gradient-reverse {
    background: linear-gradient(135deg, 
        var(--cream-yellow) 0%,
        var(--mint-light) 30%,
        var(--mint-medium) 65%,
        var(--teal-deep) 100%
    ) !important;
    color: var(--text-dark) !important;
}

/* Diagonal gradient */
.bg-gradient-diagonal {
    background: linear-gradient(45deg, 
        var(--teal-deep) 0%,
        var(--mint-medium) 50%,
        var(--cream-yellow) 100%
    ) !important;
    color: var(--text-dark) !important;
}

/* Radial gradient variant */
.bg-gradient-radial {
    background: radial-gradient(ellipse at center, 
        var(--mint-light) 0%,
        var(--mint-medium) 40%,
        var(--teal-deep) 100%
    ) !important;
    color: white !important;
}

/* Subtle gradient for cards/sections */
.bg-gradient-subtle {
    background: linear-gradient(135deg, 
        rgba(95, 179, 179, 0.1) 0%,
        rgba(136, 201, 153, 0.1) 35%,
        rgba(184, 230, 193, 0.1) 70%,
        rgba(240, 230, 166, 0.1) 100%
    ) !important;
}

/* ===== Enhanced Course Cards ===== */
.course-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(95, 179, 179, 0.1);
    background: white;
    border-top: 3px solid var(--mint-medium);
    height: 100%;
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(95, 179, 179, 0.15);
}

.course-image-container {
    position: relative;
    overflow: hidden;
    background: rgba(184, 230, 193, 0.1);
}

.price-overlay {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10;
}

.price-overlay .price-badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 1rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.course-card .card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.course-card .card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* ===== Badge Styles ===== */
.badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.course-card .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--teal-deep), var(--mint-medium)) !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, var(--mint-medium), var(--mint-light)) !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, var(--teal-deep), #0369a1) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, var(--cream-yellow), #facc15) !important;
    color: #374151 !important;
}

/* ===== Course Card Text ===== */
.course-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
    line-height: 1.4;
}

.course-card .card-text {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-medium);
    flex-grow: 1;
    margin-bottom: 1rem;
}

.course-card .card-text.small {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.course-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--text-medium);
}

/* ===== Price Section ===== */
.price-section {
    margin-top: auto;
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.price-badge {
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 1.5rem;
    font-size: 0.875rem;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.price-free {
    background: linear-gradient(135deg, var(--mint-medium), var(--mint-light));
    color: white;
}

.price-paid {
    background: linear-gradient(135deg, var(--teal-deep), var(--mint-medium));
    color: white;
}

.price-discount {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.price-early-bird {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.original-price {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

/* ===== Button Styles ===== */
.btn-outline-primary {
    color: var(--teal-deep);
    border-color: var(--teal-deep);
    border-radius: 0.75rem;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: var(--teal-deep);
    border-color: var(--teal-deep);
    color: white;
    transform: translateY(-2px);
}

/* ===== Search and Filter Card ===== */
.search-card {
    border-radius: 1rem;
    border: none;
    box-shadow: 0 4px 6px rgba(95, 179, 179, 0.1);
}

.search-card .card-header {
    background: linear-gradient(135deg, var(--teal-deep), var(--mint-medium));
    color: white;
    border-radius: 1rem 1rem 0 0 !important;
    border: none;
}

/* ===== Form Controls ===== */
.form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--teal-deep);
    box-shadow: 0 0 0 0.2rem rgba(95, 179, 179, 0.25);
}

/* ===== Results Summary ===== */
.results-summary {
    background: rgba(184, 230, 193, 0.2);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

/* ===== No Results ===== */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-medium);
}

.no-results i {
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* ===== Pagination ===== */
.pagination {
    justify-content: center;
    margin-top: 2rem;
}

.page-link {
    color: var(--teal-deep);
    border-color: #d1d5db;
    border-radius: 0.5rem;
    margin: 0 0.1rem;
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: var(--teal-deep);
    border-color: var(--teal-deep);
    color: white;
}

.page-item.active .page-link {
    background-color: var(--teal-deep);
    border-color: var(--teal-deep);
}

/* ===== Mobile Responsive ===== */
@media (max-width: 576px) {
    .price-overlay {
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .price-overlay .price-badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    
    .course-card .card-body {
        padding: 1rem;
    }
    
    .course-card .card-img-top {
        height: 200px;
    }
    
    .course-card .card-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .course-card .card-text {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }
    
    .course-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        font-size: 0.75rem;
    }
    
    .price-section {
        gap: 0.5rem;
    }
    
    .btn-outline-primary {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .course-card .card-img-top {
        height: 300px;
    }
}

/* ===== Animation ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.course-card {
    animation: fadeInUp 0.6s ease-out;
}