/* ============================================================
   UPSKILL.ID - COURSE CATALOG PAGE CSS
============================================================ */


/* ============================================================
   1. CATALOG HERO BANNER
   ============================================================ */

.catalog-hero {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.catalog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 20% 50%, rgba(234, 179, 8, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.catalog-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.catalog-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    margin-bottom: 16px;
}

.catalog-breadcrumb a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

.catalog-breadcrumb a:hover {
    color: #EAB308;
}

.catalog-breadcrumb-separator {
    opacity: 0.5;
}

.catalog-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 12px;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .catalog-title {
        font-size: 2.5rem;
    }
}

.catalog-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.125rem;
    margin-bottom: 32px;
}

/* Search Bar */
.catalog-search {
    background: white;
    border-radius: 16px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 640px;
    margin: 0 auto 24px;
}

.catalog-search-icon {
    padding-left: 16px;
    color: #94A3B8;
    font-size: 1.25rem;
}

.catalog-search-input {
    flex: 1;
    padding: 12px 8px;
    border: none;
    outline: none;
    font-size: 1rem;
    color: #1E293B;
    background: transparent;
    min-width: 0;
}

.catalog-search-input::placeholder {
    color: #94A3B8;
}

.catalog-search-btn {
    padding: 12px 24px;
    background: #EAB308;
    color: #1E293B;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.catalog-search-btn:hover {
    background: #FDE047;
    transform: translateY(-1px);
}

/* Stats */
.catalog-hero-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9375rem;
    flex-wrap: wrap;
}

.catalog-hero-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}


/* ============================================================
   2. CATALOG LAYOUT (Sidebar + Main)
   ============================================================ */

.catalog-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 1024px) {
    .catalog-container {
        grid-template-columns: 280px 1fr;
    }
}


/* ============================================================
   3. SIDEBAR FILTERS (Desktop)
   ============================================================ */

.catalog-sidebar {
    display: none;
    position: sticky;
    top: 24px;
    height: fit-content;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

@media (min-width: 1024px) {
    .catalog-sidebar {
        display: block;
    }
}

.filter-panel {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #E2E8F0;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #F1F5F9;
}

.filter-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1E293B;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-reset-btn {
    background: none;
    border: none;
    color: #EAB308;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.filter-reset-btn:hover {
    background: #FEF9C3;
}

/* Filter Section */
.filter-section {
    padding: 16px 0;
    border-bottom: 1px solid #F1F5F9;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-section-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.filter-section-arrow {
    color: #94A3B8;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.filter-section.collapsed .filter-section-arrow {
    transform: rotate(-90deg);
}

.filter-section-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filter-section.collapsed .filter-section-content {
    max-height: 0;
}

/* Checkbox Filter */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.875rem;
    color: #475569;
}

.filter-checkbox:hover {
    background: #F8FAFC;
    color: #1E293B;
}

.filter-checkbox input[type="checkbox"],
.filter-checkbox input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #EAB308;
    cursor: pointer;
    flex-shrink: 0;
}

.filter-checkbox-label {
    flex: 1;
    cursor: pointer;
}

.filter-checkbox-count {
    color: #94A3B8;
    font-size: 0.75rem;
    background: #F1F5F9;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 600;
}


/* ============================================================
   4. CATALOG MAIN AREA
   ============================================================ */

.catalog-main {
    min-height: 400px;
}

/* Toolbar */
.catalog-toolbar {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.catalog-result-count {
    color: #64748B;
    font-size: 0.9375rem;
}

.catalog-result-count strong {
    color: #1E293B;
    font-weight: 700;
}

.catalog-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Sort Dropdown */
.catalog-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.catalog-sort-label {
    color: #64748B;
    font-size: 0.875rem;
    font-weight: 500;
}

.catalog-sort-select {
    padding: 8px 12px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    color: #1E293B;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.catalog-sort-select:hover,
.catalog-sort-select:focus {
    border-color: #EAB308;
}

/* Mobile Filter Button */
.mobile-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #1E293B;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.2s ease;
}

.mobile-filter-btn:hover {
    background: #0F172A;
}

@media (min-width: 1024px) {
    .mobile-filter-btn {
        display: none;
    }
}

.mobile-filter-badge {
    background: #EAB308;
    color: #1E293B;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}


/* ============================================================
   5. ACTIVE FILTER CHIPS
   ============================================================ */

.catalog-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    align-items: center;
}

.catalog-active-filters-label {
    font-size: 0.875rem;
    color: #64748B;
    font-weight: 600;
    margin-right: 4px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #FEF9C3;
    color: #713F12;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid #FDE047;
    animation: slideIn 0.2s ease;
}

.filter-chip-remove {
    background: none;
    border: none;
    color: currentColor;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    font-family: inherit;
}

.filter-chip-remove:hover {
    opacity: 1;
}

.filter-clear-all {
    background: none;
    border: none;
    color: #EF4444;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 8px;
    font-family: inherit;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* ============================================================
   6. COURSES GRID
   ============================================================ */

.catalog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    min-height: 300px;
}

@media (min-width: 640px) {
    .catalog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1280px) {
    .catalog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* ============================================================
   7. EMPTY STATE
   ============================================================ */

.catalog-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    border: 2px dashed #E2E8F0;
}

.catalog-empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    display: block;
    opacity: 0.5;
}

.catalog-empty-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 8px;
}

.catalog-empty-description {
    color: #64748B;
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.catalog-empty-btn {
    padding: 10px 24px;
    background: #EAB308;
    color: #1E293B;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.catalog-empty-btn:hover {
    background: #FDE047;
    transform: translateY(-1px);
}


/* ============================================================
   8. LOAD MORE BUTTON
   ============================================================ */

.catalog-load-more {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.load-more-btn {
    padding: 14px 40px;
    background: white;
    color: #1E293B;
    border: 2px solid #1E293B;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.9375rem;
}

.load-more-btn:hover:not(:disabled) {
    background: #1E293B;
    color: white;
    transform: translateY(-2px);
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* ============================================================
   9. MOBILE FILTER DRAWER
   ============================================================ */

.mobile-filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-filter-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-filter-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 360px;
    height: 100vh;
    background: white;
    z-index: 1050;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-filter-drawer.active {
    left: 0;
}

.mobile-filter-drawer-header {
    padding: 20px;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    flex-shrink: 0;
}

.mobile-filter-drawer-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1E293B;
}

.mobile-filter-drawer-close {
    width: 36px;
    height: 36px;
    background: #F1F5F9;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    color: #1E293B;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-filter-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.mobile-filter-drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid #E2E8F0;
    background: white;
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.mobile-filter-drawer-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.9375rem;
    border: none;
}

.mobile-filter-drawer-btn-reset {
    background: white;
    color: #1E293B;
    border: 2px solid #1E293B;
}

.mobile-filter-drawer-btn-reset:hover {
    background: #F8FAFC;
}

.mobile-filter-drawer-btn-apply {
    background: #EAB308;
    color: #1E293B;
}

.mobile-filter-drawer-btn-apply:hover {
    background: #FDE047;
}

body.mobile-filter-open {
    overflow: hidden;
}


/* ============================================================
   10. LOADING STATE (Skeleton)
   ============================================================ */

.catalog-loading {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 640px) {
    .catalog-loading {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1280px) {
    .catalog-loading {
        grid-template-columns: repeat(3, 1fr);
    }
}

.skeleton-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.skeleton-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(90deg, #F1F5F9 0%, #E2E8F0 50%, #F1F5F9 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-content {
    padding: 16px;
}

.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, #F1F5F9 0%, #E2E8F0 50%, #F1F5F9 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 6px;
    margin-bottom: 8px;
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-line.medium {
    width: 80%;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 640px) {
    .catalog-hero {
        padding: 40px 0;
    }
    
    .catalog-title {
        font-size: 1.75rem;
    }
    
    .catalog-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .catalog-result-count {
        text-align: center;
    }
    
    .catalog-toolbar-right {
        justify-content: space-between;
    }
    
    .catalog-hero-stats {
        gap: 16px;
        font-size: 0.8125rem;
    }
}