/* ==================== LOADING & ERROR STATES ==================== */

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg-primary);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 16px;
}

.error-container {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg-primary);
    text-align: center;
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

#app {
    display: none;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* ==================== LAYOUT STRUCTURE ==================== */

.top-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 999;
    backdrop-filter: blur(10px);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    font-size: 1.1rem;
}

.brand-icon {
    font-size: 1.5rem;
}

.admin-badge {
    background: var(--warning);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    display: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.admin-badge:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    padding-bottom: 80px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    z-index: 1000;
    padding: 0.5rem 0;
}

.nav-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 0 1rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-scroll-container::-webkit-scrollbar {
    display: none;
}

/* ==================== HOME PAGE STYLES ==================== */

.home-page {
    padding-bottom: 100px;
}

.hero-section {
    background: linear-gradient(135deg, var(--accent), #4ca8d6);
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('https://images.unsplash.com/photo-1559757148-5c350d0d3c56?w=800&h=400&fit=crop') center/cover;
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: white;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    color: white;
}

.hero-search {
    display: flex;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto 2rem auto;
}

.search-input {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-base);
    color: #1e293b;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.stat {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 0.75rem;
    backdrop-filter: blur(10px);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-number {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: 0.25rem;
    color: #ffffff !important;
}

.stat-label {
    font-size: var(--font-size-sm);
    opacity: 1;
    color: #ffffff !important;
    font-weight: var(--font-weight-medium);
}

/* ==================== CONTENT SECTIONS ==================== */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

h2.section-title,
.section-title {
    font-size: var(--font-size-2xl) !important;
    font-weight: var(--font-weight-bold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.5rem 0;
}

.quick-nav-section,
.featured-section,
.live-section,
.events-section,
.news-section,
.learning-stats-section {
    margin-bottom: 3rem;
}

/* ==================== ADMIN PANEL ==================== */

.admin-panel {
    padding: 1rem;
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.admin-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 0.5rem 0.5rem 0 0;
    transition: all 0.3s;
}

.admin-tab.active {
    background: var(--accent);
    color: white;
}

.admin-content {
    background: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-stat {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 0.75rem;
    text-align: center;
}

.admin-stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.admin-stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.admin-actions {
    display: flex;
    gap: 0.5rem;
}

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

@media (max-width: 768px) {
    .header-brand .brand-text {
        display: none;
    }
    
    .nav-label {
        font-size: 0.65rem;
    }
    
    .bottom-nav .nav-btn {
        min-width: 50px;
        padding: 0.4rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: var(--font-size-base);
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-search {
        flex-direction: column;
    }

    /* Note: .main-navigation-grid single column is handled in navigation.css for mobile */

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

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .admin-tabs {
        flex-wrap: wrap;
    }

    .admin-table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0.5rem;
    }
    
    .hero-section {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .nav-card-overlay {
        padding: 1rem;
    }

    .nav-card-overlay h3 {
        font-size: 1.1rem;
    }

    .nav-scroll-container {
        padding: 0 0.5rem;
    }
    
    .bottom-nav .nav-btn {
        min-width: 45px;
    }
    
    .nav-icon {
        font-size: 1.1rem;
    }
    
    .nav-label {
        font-size: 0.6rem;
    }

    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
}

/* ==================== FOOTER ==================== */

.main-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
}

/* ==================== DETAIL PAGES ==================== */

.detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover {
    background: var(--bg-secondary);
}

.detail-content {
    background: var(--bg-card);
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.detail-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.detail-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.detail-description {
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.detail-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.module-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.module-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.module-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.module-icon {
    font-size: 1.5rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.module-content {
    flex: 1;
}

.module-title {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.module-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.module-duration {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.instructor-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.instructor-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.instructor-info {
    flex: 1;
}

.instructor-name {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.instructor-specialization {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.instructor-bio {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}