/* ============================================
   ACADEMY CATEGORY PAGE
   ============================================ */

:root {
    --primary-color: #193c76;
    --secondary-color: #0077b6;
    --accent-color: #00b4d8;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* ============================================
   CATEGORY HEADER
   ============================================ */

.category-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding-top: 80px;
}

.category-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 40px 0 60px;
    margin-bottom: 40px;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 20px;
}

.breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb-item a:hover {
    color: white;
}

.breadcrumb-item.active {
    color: white;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.6);
}

.category-info {
    display: flex;
    align-items: center;
    gap: 24px;
}

.category-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.category-content {
    flex: 1;
}

.parent-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
}

.parent-category-badge i {
    font-size: 12px;
}

.category-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.2;
}

.category-description {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 20px;
    max-width: 800px;
}

.category-stats {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.stat-item i {
    font-size: 18px;
}

/* ============================================
   FILTER BAR - UPDATED
   ============================================ */

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.filter-left .result-count {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.filter-left .result-count span {
    color: var(--primary-color);
}

.filter-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-label i {
    color: var(--primary-color);
}

#sortFilter {
    min-width: 200px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    transition: all 0.3s;
    cursor: pointer;
    background-color: white;
}

#sortFilter:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(25, 60, 118, 0.1);
    outline: none;
}

#sortFilter:hover {
    border-color: var(--primary-color);
}

/* ============================================
   COURSES GRID
   ============================================ */

.courses-section {
    padding: 0 0 60px;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   MODULE CARD (Academy Card Component)
   ============================================ */

.module-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.module-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.module-card.owned {
    border: 2px solid var(--success-color);
}

.module-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background: var(--light-color);
}

.module-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.module-card:hover .module-image {
    transform: scale(1.05);
}

.owned-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--success-color);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--danger-color);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.module-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.module-tag {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    align-self: flex-start;
}

.module-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 16px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 50px;
}

.module-price-old {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 4px;
}

.module-price-new {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.btn-order-small {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
    text-decoration: none;
}

.btn-order-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 60, 118, 0.3);
    color: white;
}

.btn-order-small.btn-owned {
    background: linear-gradient(135deg, var(--success-color), #20c997);
}

.btn-order-small.btn-owned:hover {
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.expiry-info {
    font-size: 12px;
    color: #666;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
}

.expiry-info.lifetime {
    color: var(--success-color);
    font-weight: 600;
}

.expiry-info i {
    font-size: 14px;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.no-courses {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.no-courses i {
    font-size: 64px;
    color: var(--border-color);
    margin-bottom: 20px;
}

.no-courses h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 12px;
}

.no-courses p {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
}

.no-courses .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.no-courses .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 60, 118, 0.3);
}

/* ============================================
   LOADING STATE - UPDATED
   ============================================ */

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.loading-state i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.loading-state p {
    font-size: 1rem;
    color: #666;
    margin: 0;
}

/* ============================================
   PAGINATION STYLES - NEW
   ============================================ */

.pagination-wrapper {
    margin-top: 3rem;
    padding: 2rem 0;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination .page-item {
    margin: 0;
}

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--dark-color);
    background-color: #fff;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.pagination .page-link:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(25, 60, 118, 0.15);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(25, 60, 118, 0.3);
}

.pagination .page-item.disabled .page-link {
    color: #bbb;
    background-color: var(--light-color);
    border-color: var(--border-color);
    cursor: not-allowed;
    pointer-events: none;
}

.pagination .page-link i {
    font-size: 0.85rem;
}

.pagination-info {
    margin-top: 1rem;
    text-align: center;
}

.pagination-info small {
    color: #666;
    font-size: 0.9rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 992px) {
    .category-title {
        font-size: 28px;
    }

    .courses-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .category-page {
        padding-top: 70px;
    }

    .category-header {
        padding: 30px 0 40px;
    }

    .category-info {
        flex-direction: column;
        text-align: center;
    }

    .category-title {
        font-size: 24px;
    }

    .category-stats {
        justify-content: center;
    }

    .filter-bar {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .filter-right {
        flex-direction: column;
        align-items: stretch;
    }

    #sortFilter {
        width: 100%;
    }

    .courses-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }

    /* Pagination responsive */
    .pagination {
        gap: 0.25rem;
    }
    
    .pagination .page-link {
        min-width: 36px;
        height: 36px;
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }
    
    /* Hide some page numbers on mobile */
    .pagination .page-item:not(.active):not(:first-child):not(:last-child):not(:nth-child(2)):not(:nth-last-child(2)) {
        display: none;
    }
}

@media (max-width: 576px) {
    .category-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    .category-title {
        font-size: 20px;
    }

    .category-description {
        font-size: 14px;
    }

    .courses-grid {
        grid-template-columns: 1fr;
    }

    .module-title {
        font-size: 16px;
    }

    .module-price-new {
        font-size: 20px;
    }

    .pagination .page-link {
        min-width: 32px;
        height: 32px;
        padding: 0.3rem 0.5rem;
        font-size: 0.85rem;
    }
}