/* Courses list page specific styles */
.courses-page {
    position: relative;
    min-height: 100vh;
    padding: 5rem 0;
    background: var(--bg-primary);
    overflow: hidden;
    transition: background 0.3s ease;
}

.courses-page::before,
.courses-page::after {
    display: none;
}

.grid-overlay {
    display: none;
}

.courses-header {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin-bottom: 3rem;
}

.courses-header .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--gradient-start);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.courses-header h1 {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: 800;
    color: var(--text-white);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.courses-header p {
    font-size: 1.1rem;
    color: var(--text-muted-white);
    transition: color 0.3s ease;
}

/* Search and Filter Section */
.courses-filter-section {
    position: relative;
    z-index: 1;
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.search-container {
    position: relative;
    max-width: 600px;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted-white);
    font-size: 1.1rem;
    pointer-events: none;
    transition: color 0.3s ease;
}

.course-search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-white);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.course-search-input::placeholder {
    color: var(--text-muted-white);
    opacity: 0.7;
}

.course-search-input:focus {
    border-color: #ff9900;
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.1);
    background: var(--bg-secondary);
}

.course-search-input:focus + .search-icon,
.search-container:focus-within .search-icon {
    color: #ff9900;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.filter-btn {
    padding: 0.65rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-muted-white);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    white-space: nowrap;
}

.filter-btn:hover {
    background: var(--bg-tertiary);
    border-color: rgba(255, 153, 0, 0.3);
    color: var(--text-white);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #ff9900;
    border-color: #ff9900;
    color: #000000;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3);
}

.filter-btn.active:hover {
    background: #ffaa11;
    border-color: #ffaa11;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 153, 0, 0.4);
}

.no-results-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted-white);
}

.no-results-message p {
    font-size: 1.1rem;
    margin: 0;
}

/* Courses Section */
.courses-section {
    position: relative;
    z-index: 1;
    margin-bottom: 4rem;
}

.courses-section:last-child {
    margin-bottom: 0;
}

.section-header {
    margin-bottom: 2rem;
}

.section-title {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: color 0.3s ease;
}

.section-title i {
    color: var(--gradient-start);
    font-size: 1.5rem;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-muted-white);
    margin: 0;
    transition: color 0.3s ease;
}

.courses-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.8rem;
}

.course-card {
    background: #ff9900;
    color: #000000;
    backdrop-filter: blur(20px);
    border: 1px solid var(--tile-border);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 15px 35px var(--shadow);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, background 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.course-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #ff9900, #ff7700);
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 0;
}

.course-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 55px rgba(255, 153, 0, 0.3);
    border-color: rgba(255, 153, 0, 0.4);
}

.course-card:hover::after {
    opacity: 1;
}

.course-card > * {
    position: relative;
    z-index: 1;
}

.course-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.course-category {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: #000000;
    width: fit-content;
    max-width: 100%;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.course-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000000;
    margin: 0;
    transition: color 0.3s ease;
    line-height: 1.3;
}

.course-description {
    color: rgba(0, 0, 0, 0.8);
    line-height: 1.6;
    margin: 0;
    transition: color 0.3s ease;
    flex-grow: 1;
    font-size: 0.95rem;
}

/* New Stats Grid */
.course-stats-grid {
    display: grid;
    grid-template-columns: 0.75fr 1.25fr;
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.stat-item-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.5rem;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.stat-item-rating .stat-icon-wrapper {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.stat-item-rating .stat-icon-wrapper i {
    font-size: 1.1rem;
}

.stat-item-enrollment {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
    min-width: 0;
}

.stat-item-rating:hover,
.stat-item-enrollment:hover {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.stat-icon-wrapper i {
    font-size: 1.2rem;
    color: #000000;
    font-weight: 600;
}

.stat-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.stat-item-rating .stat-content-wrapper {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: #000000;
    line-height: 1;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.85);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rating-display-compact {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.stat-item-rating .rating-display-compact {
    gap: 0.2rem;
    width: 100%;
}

.rating-value-compact {
    font-size: 1.05rem;
    font-weight: 700;
    color: #000000;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-item-rating .rating-value-compact {
    font-size: 0.95rem;
    max-width: 100%;
}

.star-rating-mini {
    display: flex;
    gap: 0.1rem;
    align-items: center;
    flex-shrink: 1;
    min-width: 0;
}

.stat-item-rating .star-rating-mini {
    gap: 0.06rem;
    max-width: 100%;
}

.star-rating-mini i {
    font-size: 0.7rem;
    color: #ffd700;
    flex-shrink: 0;
}

.stat-item-rating .star-rating-mini i {
    font-size: 0.6rem;
}

.star-rating-mini .bi-star {
    color: rgba(0, 0, 0, 0.2);
}

.no-rating-text {
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 500;
}

.course-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.5rem;
}

.course-inline-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.7);
    font-weight: 600;
    white-space: nowrap;
}

.course-inline-meta i {
    font-size: 0.95rem;
    color: #000000;
}

.course-price {
    font-weight: 700;
    color: #000000;
}

.course-price i {
    font-size: 1rem;
}

.star-rating-inline {
    display: inline-flex;
    gap: 0.15rem;
    align-items: center;
    margin-left: 0.25rem;
}

.star-rating-inline i {
    font-size: 0.7rem;
    color: #ffd700;
}

.star-rating-inline .bi-star {
    color: rgba(0, 0, 0, 0.2);
}

.course-meta i {
    color: #000000;
}

/* Course Action Buttons */
.course-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    align-items: stretch;
}

.enroll-form {
    flex: 1;
    display: flex;
    margin: 0;
    padding: 0;
}

.btn-enroll,
.btn-view-course,
.btn-unenroll,
.btn-start-learning {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 48px;
    white-space: nowrap;
}

.btn-enroll {
    background: #000000;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: 100%;
}

.btn-enroll:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    color: #ffffff;
}

.btn-view-course {
    background: rgba(255, 255, 255, 0.95);
    color: #000000;
    border: 2px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.btn-view-course:hover {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #000000;
}

.btn-start-learning {
    background: #000000;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: 100%;
}

.btn-start-learning:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    color: #ffffff;
}

.btn-unenroll {
    background: rgba(239, 68, 68, 0.1);
    color: rgba(239, 68, 68, 0.9);
    border: 2px solid rgba(239, 68, 68, 0.3);
    width: 100%;
}

.btn-unenroll:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.5);
    color: rgba(239, 68, 68, 1);
    transform: translateY(-2px);
}

.btn-enroll i,
.btn-view-course i,
.btn-unenroll i,
.btn-start-learning i,
.btn-pending i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.btn-pending i {
    animation: pending-spin 2s linear infinite;
}

@keyframes pending-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn-pending {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.6);
    cursor: not-allowed;
    opacity: 0.7;
    min-height: 48px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .courses-page {
        padding: 4rem 0;
    }
    
    .courses-filter-section {
        margin-bottom: 2rem;
        gap: 1.25rem;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .filter-buttons {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.55rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .course-card {
        padding: 1.5rem;
    }
    
    .course-card h2 {
        font-size: 1.3rem;
    }
    
    .course-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        padding: 0.75rem 0;
    }
    
    .stat-item-module,
    .stat-item-rating,
    .stat-item-enrollment {
        flex-direction: column;
        gap: 0.4rem;
        padding: 0.5rem 0.25rem;
        text-align: center;
    }
    
    .stat-icon-wrapper {
        width: 32px;
        height: 32px;
    }
    
    .stat-icon-wrapper i {
        font-size: 1rem;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .rating-display-compact {
        align-items: center;
    }
    
    .star-rating-mini {
        justify-content: center;
    }
    
    .course-actions {
        flex-direction: column;
        gap: 0.65rem;
    }
    
    .enroll-form {
        width: 100%;
    }
    
    .btn-enroll,
    .btn-view-course,
    .btn-unenroll,
    .btn-start-learning,
    .btn-pending {
        width: 100%;
    }
}


