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

/* Large Screens */
@media (max-width: 1200px) {
    .section-title { font-size: 2.2rem; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Tablets */
@media (max-width: 992px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: rgba(10, 10, 15, 0.95);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        flex-direction: column;
        padding: 100px 30px 30px;
        transition: var(--transition-slow);
        border-left: 1px solid var(--glass-border);
        overflow-y: auto;
        z-index: 999;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-link {
        width: 100%;
        padding: 12px 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-link.active::after {
        display: none;
    }

    .nav-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
        margin-top: 5px;
    }

    .hero-title { font-size: 2.5rem; }
    .section-title { font-size: 2rem; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    
    /* Admin sidebar */
    .admin-sidebar {
        position: fixed;
        right: -280px;
        z-index: 1000;
        transition: var(--transition-slow);
    }

    .admin-sidebar.active {
        right: 0;
    }

    .admin-main {
        margin-right: 0 !important;
    }

    .sidebar-toggle {
        display: flex !important;
    }
}

/* Mobile */
@media (max-width: 768px) {
    html { font-size: 14px; }

    .section { padding: 60px 0; }
    .section-container { padding: 0 20px; }
    .section-title { font-size: 1.8rem; }
    .section-header { margin-bottom: 40px; }

    .hero-title { font-size: 2rem; }
    .hero-subtitle { font-size: 1rem; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .hero-buttons .btn { width: 100%; justify-content: center; }

    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .footer-bottom-content { flex-direction: column; gap: 10px; }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

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

    .btn-lg { padding: 14px 30px; font-size: 1rem; }

    .card { padding: 20px; }

    /* Dashboard */
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
    .dashboard-header { flex-direction: column; gap: 15px; }

    /* Tables */
    .data-table { font-size: 0.8rem; }
    .data-table th, .data-table td { padding: 10px 12px; }

    /* Forms */
    .form-row { flex-direction: column; }
    .form-row .form-group { width: 100%; }

    /* Auth pages */
    .auth-container { padding: 20px; }
    .auth-card { padding: 30px 20px; }

    /* Gallery */
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }

    /* Course cards */
    .course-card-horizontal { flex-direction: column; }
    .course-card-image { width: 100%; height: 200px; }
}

/* Small Mobile */
@media (max-width: 480px) {
    html { font-size: 13px; }

    .nav-container { padding: 0 15px; }
    .section-container { padding: 0 15px; }
    
    .hero-title { font-size: 1.7rem; }
    .section-title { font-size: 1.5rem; }

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

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

    .footer-container { padding: 60px 15px 20px; }

    .btn { padding: 10px 20px; font-size: 0.85rem; }
    .btn-lg { padding: 12px 25px; font-size: 0.95rem; }

    .logo-fa { font-size: 1rem; }
    .logo-en { font-size: 0.55rem; }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar, .back-to-top, .footer-social, #particles-bg, #audio-visualizer, .loader-overlay {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .glass-card, .glass-panel {
        background: white;
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* ===== LANDSCAPE ORIENTATION ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section { min-height: auto; padding: 100px 0 60px; }
    .nav-menu { padding-top: 70px; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .loader-overlay { display: none; }
}

/* ===== HIGH CONTRAST ===== */
@media (prefers-contrast: high) {
    :root {
        --glass-border: rgba(255, 255, 255, 0.3);
        --text-secondary: #d4d4d8;
        --text-muted: #a1a1aa;
    }
}
