/**
 * responsive.css
* Responsive Stylesheet
 * study.rkutumb.in
 */

/* ========================================
   TABLET (768px - 1024px)
   ======================================== */
@media (max-width: 1024px) {
    .nav-container {
        padding: 1rem;
    }
    
    .nav-menu {
        gap: 1.5rem;
    }
    
    .hero-section {
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .exams-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* ========================================
   MOBILE (max-width: 768px)
   ======================================== */
@media (max-width: 768px) {
    /* Navigation */
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: #fff;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-item {
        margin: 1rem 0;
    }
    
    /* Hero Section */
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-image {
        order: -1;
    }
    
    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    /* Exams */
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .exams-grid {
        grid-template-columns: 1fr;
    }
    
    /* Exam Taking */
    .exam-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .exam-timer {
        width: 100%;
        justify-content: center;
    }
    
    .question-navigator {
        padding: 1rem;
    }
    
    .nav-buttons {
        grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
    }
    
    .nav-button {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }
    
    .legend {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .question-container {
        padding: 1rem;
    }
    
    .question-text {
        font-size: 1rem;
    }
    
    .exam-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .exam-navigation .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Results */
    .results-container {
        grid-template-columns: 1fr;
    }
    
    .result-stats {
        grid-template-columns: 1fr;
    }
    
    /* Leaderboard */
    .leaderboard-container {
        overflow-x: auto;
    }
    
    .leaderboard-table {
        min-width: 600px;
    }
    
    /* Profile */
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-stats {
        grid-template-columns: 1fr;
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        margin: 1rem;
    }
    
    /* Main Content */
    .main-content {
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}





   /* ========================================
   MOBILE MENU FIXES
   ======================================== */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
        gap: 5px;
        display: none;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    
    .nav-menu.show {
        display: flex;
    }
    
    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 15px;
    }
    
    .nav-link.active::after {
        display: none;
    }
    
    .user-dropdown {
        width: 100%;
        justify-content: space-between;
    }
    
    .dropdown-menu {
        position: static;
        width: 100%;
        margin-top: 10px;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
    
    .user-dropdown:hover .dropdown-menu,
    .dropdown-menu:hover {
        position: static;
    }
}


/* ========================================
   SMALL MOBILE (max-width: 480px)
   ======================================== */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .nav-brand {
        font-size: 1rem;
    }
    
    .nav-logo {
        height: 30px;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .exam-container {
        padding: 1rem;
    }
    
    .exam-header {
        padding-bottom: 1rem;
    }
    
    .exam-timer {
        font-size: 1.25rem;
    }
    
    .nav-buttons {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.3rem;
    }
    
    .nav-button {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    .option {
        padding: 0.75rem;
    }
    
    .option input[type="radio"] {
        width: 18px;
        height: 18px;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .feature-icon {
        font-size: 2.5rem;
    }
    
    .exam-card {
        margin-bottom: 1rem;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
    }
    
    .stat-item .stat-value {
        font-size: 1.5rem;
    }
    
    .toast {
        bottom: 10px;
        right: 10px;
        left: 10px;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .footer {
        padding: 1.5rem 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ========================================
   LANDSCAPE ORIENTATION
   ======================================== */
@media (max-height: 600px) and (orientation: landscape) {
    .exam-container {
        padding: 1rem;
    }
    
    .exam-header {
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .question-navigator {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .question-container {
        min-height: 200px;
        padding: 1rem;
    }
    
    .modal-content {
        max-height: 95vh;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .navbar,
    .hamburger,
    .exam-navigation,
    .footer,
    .modal,
    .toast {
        display: none !important;
    }
    
    .exam-container {
        box-shadow: none;
    }
    
    .question-navigator {
        display: none;
    }
    
    .exam-header {
        border-bottom: 2px solid #000;
    }
    
    body {
        background-color: #fff;
    }
    
    .option {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}

/* ========================================
   HIGH DPI DISPLAYS
   ======================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .nav-logo,
    .profile-avatar,
    .user-avatar {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #1F1F1F;
        --text-color: #E8EAED;
        --dark-color: #F8F9FA;
        --border-color: #5F6368;
    }
    
    body {
        background-color: #202124;
        color: var(--text-color);
    }
    
    .navbar,
    .exam-container,
    .feature-card,
    .exam-card,
    .result-card,
    .profile-card,
    .leaderboard-container,
    .modal-content {
        background-color: #292A2D;
    }
    
    .form-input,
    .filter-select {
        background-color: #292A2D;
        color: var(--text-color);
        border-color: var(--border-color);
    }
    
    .option {
        background-color: #292A2D;
    }
    
    .option:hover {
        background-color: rgba(66, 133, 244, 0.2);
    }
    
    .leaderboard-table tbody tr:hover {
        background-color: #3C4043;
    }
}

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

/* ========================================
   TOUCH DEVICE ENHANCEMENTS
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .option,
    .nav-button,
    .exam-card,
    .result-card {
        touch-action: manipulation;
    }
    
    .option {
        padding: 1.25rem;
        min-height: 60px;
    }
    
    .nav-button {
        min-width: 44px;
        min-height: 44px;
    }
    
    .btn {
        min-height: 48px;
    }
}
