/**
 * TMT - Target Mock Test
 * Responsive Stylesheet
 * 
 * यह फाइल सभी Screen Sizes के लिए Responsive Design Handle करती है।
 * Mobile, Tablet, Laptop, Desktop सब पर Perfect Layout के लिए Media Queries।
 * 
 * Breakpoints:
 * - Mobile: 320px - 480px
 * - Tablet: 481px - 768px
 * - Small Laptop: 769px - 1024px
 * - Desktop: 1025px - 1200px
 * - Large Desktop: 1201px+
 */

/* ============================================
   MOBILE FIRST - Base styles are mobile-first
   All styles in style.css are mobile-first
   ============================================ */

/* ============================================
   EXTRA SMALL (XS) - 320px to 480px
   ============================================ */
@media screen and (max-width: 480px) {
    /* Header */
    .header-container {
        padding: 0.25rem 0.5rem;
        min-height: 50px;
    }
    
    .header-logo {
        width: 32px;
        height: 32px;
    }
    
    .brand-name {
        font-size: 1.1rem;
    }
    
    .brand-full {
        font-size: 0.6rem;
    }
    
    .brand-tagline {
        font-size: 0.45rem;
    }
    
    .header-language .lang-link {
        font-size: 0.6rem;
        padding: 1px 3px;
    }
    
    .header-language .lang-separator {
        font-size: 0.5rem;
    }
    
    .header-btn {
        padding: 3px 8px;
        font-size: 0.6rem;
    }
    
    .header-btn span {
        display: none;
    }
    
    .header-btn i {
        font-size: 0.85rem;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .user-name-mobile {
        display: none;
    }
    
    .hamburger-line {
        width: 18px;
        height: 2px;
    }
    
    .hamburger-label {
        font-size: 0.4rem;
    }
    
    /* Sidebar */
    .sidebar-menu {
        width: 280px;
        max-width: 80vw;
    }
    
    .sidebar-brand-name {
        font-size: 1rem;
    }
    
    .sidebar-nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .sidebar-nav-link i {
        font-size: 0.85rem;
    }
    
    /* Main Content */
    .main-content {
        padding: var(--spacing-sm);
    }
    
    /* Home Page */
    .home-hero {
        padding: var(--spacing-lg) var(--spacing-md);
        border-radius: var(--radius-md);
    }
    
    .home-hero h1 {
        font-size: var(--font-size-2xl);
    }
    
    .home-hero .tagline {
        font-size: var(--font-size-base);
    }
    
    .exam-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .exam-card {
        padding: var(--spacing-md);
    }
    
    .exam-card-title {
        font-size: 1rem;
    }
    
    /* Tests Page */
    .test-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .test-card {
        padding: var(--spacing-md);
    }
    
    .test-card-meta {
        flex-direction: column;
        gap: 2px;
    }
    
    .test-card-actions {
        flex-direction: column;
    }
    
    .test-card-btn {
        width: 100%;
        text-align: center;
    }
    
    /* Test Page */
    .test-header-bar {
        padding: var(--spacing-sm) var(--spacing-md);
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    
    .test-header-bar .test-title {
        font-size: 0.85rem;
        text-align: center;
    }
    
    .test-header-bar .test-timer {
        font-size: 0.9rem;
        text-align: center;
        padding: 2px 10px;
    }
    
    .test-body {
        padding: var(--spacing-md);
    }
    
    .test-question-number {
        font-size: 0.9rem;
    }
    
    .test-question-timer {
        font-size: 0.85rem;
    }
    
    .test-question-text {
        font-size: 0.95rem;
        padding: var(--spacing-sm);
    }
    
    .test-option {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .test-option .option-text {
        font-size: 0.85rem;
    }
    
    .test-navigation {
        flex-direction: column;
        gap: 6px;
    }
    
    .test-nav-btn {
        width: 100%;
        text-align: center;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .test-question-status {
        gap: 3px;
    }
    
    .test-status-dot {
        width: 24px;
        height: 24px;
        font-size: 0.5rem;
    }
    
    /* Result Page */
    .result-container {
        padding: var(--spacing-md);
    }
    
    .result-header .result-icon {
        font-size: 3rem;
    }
    
    .result-header h1 {
        font-size: var(--font-size-2xl);
    }
    
    .result-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
        padding: var(--spacing-md) 0;
    }
    
    .result-stat {
        padding: var(--spacing-sm);
    }
    
    .result-stat .stat-value {
        font-size: var(--font-size-xl);
    }
    
    .result-percentage .percentage-value {
        font-size: var(--font-size-3xl);
    }
    
    .result-share {
        flex-direction: column;
        align-items: stretch;
    }
    
    .result-share-btn {
        justify-content: center;
        padding: 10px;
    }
    
    /* Registration Page */
    .register-container {
        padding: var(--spacing-md);
        margin: var(--spacing-md) auto;
    }
    
    .register-container h1 {
        font-size: var(--font-size-xl);
    }
    
    .register-form .form-control {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    /* Footer */
    .footer-top {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        padding-bottom: var(--spacing-lg);
    }
    
    .footer-social-icons {
        justify-content: center;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-copyright {
        font-size: 0.65rem;
    }
    
    /* Footer Back to Top */
    .footer-back-top {
        width: 38px;
        height: 38px;
        bottom: 16px;
        right: 16px;
        font-size: 0.9rem;
    }
    
    /* Utility */
    .hide-xs {
        display: none !important;
    }
}

/* ============================================
   SMALL (SM) - 481px to 768px
   ============================================ */
@media screen and (min-width: 481px) and (max-width: 768px) {
    /* Header */
    .header-container {
        padding: 0.35rem 0.75rem;
    }
    
    .brand-name {
        font-size: 1.2rem;
    }
    
    .brand-full {
        font-size: 0.7rem;
    }
    
    .header-btn span {
        display: inline;
    }
    
    .header-btn {
        padding: 4px 12px;
        font-size: 0.7rem;
    }
    
    .user-name-mobile {
        display: inline;
        font-size: 0.75rem;
    }
    
    /* Main Content */
    .main-content {
        padding: var(--spacing-md);
    }
    
    /* Home Page */
    .exam-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    /* Tests Page */
    .test-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    /* Test Page */
    .test-header-bar {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .test-navigation {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .test-nav-btn {
        flex: 1;
        min-width: 80px;
    }
    
    /* Result Page */
    .result-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .result-share {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Footer */
    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-lg);
    }
    
    .footer-brand {
        grid-column: 1 / -1;
    }
    
    /* Utility */
    .hide-sm {
        display: none !important;
    }
}

/* ============================================
   MEDIUM (MD) - 769px to 1024px
   ============================================ */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    /* Header */
    .header-container {
        padding: 0.4rem 1rem;
    }
    
    .brand-name {
        font-size: 1.4rem;
    }
    
    .brand-full {
        font-size: 0.75rem;
    }
    
    .header-btn {
        padding: 5px 14px;
        font-size: 0.75rem;
    }
    
    /* Main Content */
    .main-content {
        padding: var(--spacing-lg);
    }
    
    /* Home Page */
    .exam-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    /* Tests Page */
    .test-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    /* Test Page */
    .test-header-bar {
        flex-direction: row;
    }
    
    .test-navigation {
        flex-direction: row;
    }
    
    /* Result Page */
    .result-stats {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Footer */
    .footer-top {
        grid-template-columns: 2fr 1fr 1fr 1.5fr;
        gap: var(--spacing-xl);
    }
    
    /* Utility */
    .hide-md {
        display: none !important;
    }
}

/* ============================================
   LARGE (LG) - 1025px to 1200px
   ============================================ */
@media screen and (min-width: 1025px) and (max-width: 1200px) {
    /* Header */
    .header-container {
        padding: 0.5rem 1.5rem;
    }
    
    .brand-name {
        font-size: 1.6rem;
    }
    
    .brand-full {
        font-size: 0.8rem;
    }
    
    /* Home Page */
    .exam-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Tests Page */
    .test-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Result Page */
    .result-stats {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Footer */
    .footer-top {
        grid-template-columns: 2fr 1fr 1fr 1.5fr;
    }
}

/* ============================================
   EXTRA LARGE (XL) - 1201px+
   ============================================ */
@media screen and (min-width: 1201px) {
    /* Header */
    .header-container {
        padding: 0.5rem 2rem;
        max-width: 1400px;
    }
    
    .brand-name {
        font-size: 1.8rem;
    }
    
    /* Main Content */
    .main-content {
        padding: var(--spacing-2xl);
        max-width: 1400px;
    }
    
    /* Home Page */
    .exam-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Tests Page */
    .test-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Result Page */
    .result-stats {
        grid-template-columns: repeat(5, 1fr);
    }
    
    /* Footer */
    .footer-container {
        max-width: 1400px;
    }
    
    .footer-top {
        grid-template-columns: 2fr 1fr 1fr 1.5fr;
    }
}

/* ============================================
   TABLET LANDSCAPE & DESKTOP NAVIGATION
   ============================================ */
@media screen and (min-width: 769px) {
    /* Hide hamburger on larger screens */
    .hamburger-btn {
        display: none !important;
    }
    
    .sidebar-menu,
    .sidebar-overlay {
        display: none !important;
    }
}

/* ============================================
   MOBILE & TABLET PORTRAIT - SHOW HAMBURGER
   ============================================ */
@media screen and (max-width: 768px) {
    .hamburger-btn {
        display: flex !important;
    }
    
    /* User name in header - hide on mobile */
    .user-name-mobile {
        display: none;
    }
    
    /* Language selector in header - show only icons on mobile */
    .header-language .lang-label {
        display: none;
    }
    
    .header-language .lang-link {
        font-size: 0.65rem;
    }
    
    /* User dropdown menu - full width on mobile */
    .user-dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        transform: translateY(100%);
        max-height: 60vh;
    }
    
    .user-dropdown-menu.open {
        transform: translateY(0);
    }
}

/* ============================================
   DARK MODE SUPPORT (Future Feature)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* This will be expanded when dark mode is implemented */
}

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

/* ============================================
   HIGH CONTRAST (Accessibility)
   ============================================ */
@media (prefers-contrast: high) {
    :root {
        --gray-50: #ffffff;
        --gray-100: #f0f0f0;
        --gray-200: #d0d0d0;
        --gray-300: #b0b0b0;
        --gray-400: #909090;
        --gray-500: #707070;
        --gray-600: #505050;
        --gray-700: #303030;
        --gray-800: #202020;
        --gray-900: #101010;
    }
    
    .test-option {
        border-width: 3px;
    }
    
    .test-option.selected {
        border-color: var(--primary);
    }
    
    .test-status-dot {
        border-width: 3px;
    }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn,
    .test-option,
    .sidebar-nav-link,
    .header-btn,
    .hamburger-btn,
    .test-nav-btn,
    .result-share-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects that might cause issues */
    .exam-card:hover {
        transform: none;
    }
    
    .test-card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    /* Better touch feedback */
    .test-option:active {
        background: var(--primary-lightest);
    }
    
    .btn:active {
        transform: scale(0.97);
    }
    
    /* Larger font for readability */
    .test-option .option-text {
        font-size: 1rem;
    }
    
    .test-question-text {
        font-size: 1.05rem;
    }
    
    /* Increased spacing */
    .test-option {
        padding: 12px 16px;
    }
    
    .test-nav-btn {
        padding: 12px 16px;
    }
}

/* ============================================
   PRINT - Override for better printing
   ============================================ */
@media print {
    /* Hide everything except content */
    .tmt-header,
    .tmt-footer,
    .sidebar-menu,
    .sidebar-overlay,
    .hamburger-btn,
    .test-navigation,
    .result-share,
    .footer-back-top,
    .user-dropdown,
    .header-language,
    .header-user {
        display: none !important;
    }
    
    /* Show full content */
    .main-content {
        padding: 20px !important;
        max-width: 100% !important;
    }
    
    .test-container,
    .result-container {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        border-radius: 4px !important;
    }
    
    /* Print colors */
    .test-option.correct {
        background: #e8f5e9 !important;
        border-color: #2e7d32 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .test-option.incorrect {
        background: #ffebee !important;
        border-color: #c62828 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .result-stat .stat-value.correct {
        color: #2e7d32 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .result-stat .stat-value.incorrect {
        color: #c62828 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    /* Page breaks */
    .result-question-review {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .test-question-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    /* Ensure all content is visible */
    .test-status-dot {
        border: 1px solid #ddd !important;
    }
    
    .test-status-dot.answered {
        background: #2e7d32 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .test-status-dot.unanswered {
        background: #e0e0e0 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* ============================================
   SPECIAL CASES
   ============================================ */

/* Very small screens (feature phones) */
@media screen and (max-width: 320px) {
    .header-logo {
        width: 28px;
        height: 28px;
    }
    
    .brand-name {
        font-size: 0.9rem;
    }
    
    .brand-full {
        font-size: 0.5rem;
    }
    
    .brand-tagline {
        font-size: 0.4rem;
    }
    
    .main-content {
        padding: 4px;
    }
    
    .test-header-bar .test-title {
        font-size: 0.7rem;
    }
    
    .test-header-bar .test-timer {
        font-size: 0.75rem;
    }
    
    .test-question-text {
        font-size: 0.85rem;
    }
    
    .test-option .option-text {
        font-size: 0.8rem;
    }
}

/* Landscape phones */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .tmt-header {
        position: static;
    }
    
    .header-container {
        min-height: 40px;
        padding: 0.2rem 0.5rem;
    }
    
    .header-logo {
        width: 28px;
        height: 28px;
    }
    
    .brand-name {
        font-size: 1rem;
    }
    
    .brand-full {
        font-size: 0.55rem;
    }
    
    .brand-tagline {
        font-size: 0.4rem;
    }
    
    .main-content {
        padding: 4px;
    }
    
    /* Test page in landscape */
    .test-body {
        padding: 8px;
    }
    
    .test-question-text {
        font-size: 0.85rem;
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .test-option {
        padding: 4px 8px;
        gap: 4px;
    }
    
    .test-option .option-text {
        font-size: 0.75rem;
    }
    
    .test-navigation {
        margin-top: 8px;
        padding-top: 8px;
    }
    
    .test-nav-btn {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
    
    .test-status-dot {
        width: 18px;
        height: 18px;
        font-size: 0.4rem;
    }
}

/* ============================================
   RTL SUPPORT (For Hindi/Urdu)
   ============================================ */
[dir="rtl"] .header-language .lang-link {
    margin-left: 4px;
    margin-right: 0;
}

[dir="rtl"] .test-option {
    flex-direction: row-reverse;
}

[dir="rtl"] .test-question-text {
    border-left: none;
    border-right: 4px solid var(--primary-light);
}

[dir="rtl"] .result-question-review .q-analysis {
    border-left: none;
    border-right: 3px solid var(--primary-light);
}

[dir="rtl"] .sidebar-nav-link {
    border-left: none;
    border-right: 3px solid transparent;
}

[dir="rtl"] .sidebar-nav-link.active {
    border-right-color: var(--primary);
}

[dir="rtl"] .sidebar-nav-link i {
    margin-left: 12px;
    margin-right: 0;
}

[dir="rtl"] .test-option .option-label {
    margin-left: 8px;
    margin-right: 0;
}

/* ============================================
   END OF RESPONSIVE.CSS
   ============================================ */
   