/* FILE: /assets/css/responsive.css */
/* Responsive Design for Mobile and Tablet - FIXED */

/* MOBILE - Small devices (up to 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: row;
        gap: 1rem;
        justify-content: space-between;
        align-items: center;
    }
    
    .logo h1 {
        font-size: 1.2rem;
        margin: 0;
    }
    
    .main-nav {
        flex-direction: row;
        width: auto;
        gap: 0.25rem;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.5rem 0;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    
    .main-nav a {
        padding: 0.5rem 0.75rem;
        text-align: center;
        border: none;
        border-radius: 4px;
        font-size: 0.85rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .main-nav a.nav-btn {
        background: var(--light-color);
        border: 1px solid var(--border-color);
        padding: 0.5rem 0.75rem;
    }
    
    .main-nav a.nav-btn.btn-primary {
        background: var(--primary-color);
        color: white;
        border: none;
    }
    
    .menu-toggle {
        display: none;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .hero-cta a {
        width: 100%;
    }
    
    section h2 {
        font-size: 1.5rem;
    }
    
    .services-grid, .profiles-grid, .testimonials-grid, .teachers-grid, .steps, .about-stats {
        grid-template-columns: 1fr;
    }
    
    .auth-box {
        padding: 1.5rem;
    }
    
    .dashboard-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dashboard-sidebar {
        padding: 1rem;
        height: auto;
    }
    
    .dashboard-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 0.25rem;
        padding: 0.5rem 0;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    
    .dashboard-nav a {
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        flex-shrink: 0;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.5rem 0;
        -webkit-overflow-scrolling: touch;
    }
    
    .admin-nav {
        flex-direction: row;
        gap: 0.25rem;
        white-space: nowrap;
    }
    
    .nav-item {
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        flex-shrink: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-table {
        font-size: 0.875rem;
    }
    
    .admin-table th, .admin-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .test-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .question-block {
        padding: 1rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    /* Hide scrollbar but keep functionality */
    .main-nav::-webkit-scrollbar,
    .dashboard-nav::-webkit-scrollbar,
    .admin-nav::-webkit-scrollbar,
    .admin-sidebar::-webkit-scrollbar {
        height: 4px;
    }
    
    .main-nav::-webkit-scrollbar-track,
    .dashboard-nav::-webkit-scrollbar-track,
    .admin-nav::-webkit-scrollbar-track,
    .admin-sidebar::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .main-nav::-webkit-scrollbar-thumb,
    .dashboard-nav::-webkit-scrollbar-thumb,
    .admin-nav::-webkit-scrollbar-thumb,
    .admin-sidebar::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 2px;
    }
}

/* TABLET - Medium devices (481px to 768px) */
@media (max-width: 768px) and (min-width: 481px) {
    .container {
        padding: 0 20px;
    }
    
    .main-nav {
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .main-nav a {
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    section h2 {
        font-size: 2rem;
    }
    
    .services-grid, .profiles-grid, .testimonials-grid, .teachers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .steps, .about-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-container {
        grid-template-columns: 200px 1fr;
        gap: 1.5rem;
    }
    
    .dashboard-sidebar {
        padding: 1rem;
        height: fit-content;
    }
    
    .dashboard-nav {
        flex-direction: column;
        gap: 0.25rem;
        overflow: visible;
    }
    
    .dashboard-nav a {
        padding: 0.6rem 0.75rem;
        font-size: 0.95rem;
        white-space: normal;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        width: 220px;
        overflow: visible;
    }
    
    .admin-nav {
        flex-direction: column;
        gap: 0;
    }
    
    .nav-item {
        white-space: normal;
        padding: 0.75rem 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* LANDSCAPE MODE */
@media (max-height: 500px) {
    .hero {
        padding: 2rem 0;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-content p {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    section {
        padding: 2rem 0;
    }
}

/* PRINT STYLES */
@media print {
    .main-header, .main-footer, .dashboard-sidebar, .admin-sidebar {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .admin-table, .results-table {
        page-break-inside: avoid;
    }
}

/* HIGH DPI SCREENS */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ACCESSIBILITY */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --dark-color: #f9fafb;
        --light-color: #1f2937;
        --text-color: #e5e7eb;
        --border-color: #374151;
    }
    
    body {
        background: #111827;
        color: #e5e7eb;
    }
}

/* Scrollable container styles */
.main-nav,
.dashboard-nav,
.admin-nav,
.admin-sidebar {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}