/**
 * Test Series Mobile Unified Styles
 * Purpose: Complete mobile optimization for test-series pages
 * Target: Native app-like experience across all test-series pages
 * Version: 1.0.0
 */

/* ===================================
   MOBILE CONTAINER OPTIMIZATIONS
   =================================== */

.mobile-container {
    padding-bottom: 80px; /* Space for bottom navigation */
    min-height: 100vh;
    background: #f8fafc;
}

@media (max-width: 767.98px) {
    .mobile-container {
        padding-bottom: 64px; /* Adjust for mobile bottom nav */
    }
}

/* ===================================
   TEST SERIES MOBILE CARDS
   =================================== */

.mobile-test-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: none;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.mobile-test-card:active {
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mobile-test-card .card-body {
    padding: 20px;
}

.mobile-test-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.4;
}

.mobile-test-card .card-text {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* ===================================
   MOBILE TEST DETAILS
   =================================== */

.mobile-test-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.mobile-test-detail {
    text-align: center;
    padding: 12px 8px;
    background: #f3f4f6;
    border-radius: 12px;
}

.mobile-test-detail .detail-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 4px;
}

.mobile-test-detail .detail-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===================================
   MOBILE SEARCH & FILTERS
   =================================== */

.mobile-search-container {
    padding: 16px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-search {
    position: relative;
    display: flex;
    align-items: center;
    background: #f9fafb;
    border-radius: 12px;
    padding: 12px 16px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.mobile-search:focus-within {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.native-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: #1f2937;
    outline: none;
    padding: 0;
}

.native-input::placeholder {
    color: #9ca3af;
}

.search-icon {
    color: #9ca3af;
    font-size: 1.1rem;
    margin-right: 8px;
}

.clear-icon {
    color: #9ca3af;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.clear-icon:hover {
    background: #f3f4f6;
    color: #6b7280;
}

/* ===================================
   MOBILE FILTER CHIPS
   =================================== */

.mobile-filter-chips {
    padding: 0 16px 16px;
    background: #ffffff;
}

.chip-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chip-container::-webkit-scrollbar {
    display: none;
}

.mobile-chip {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: #f3f4f6;
    border: none;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
}

.mobile-chip:hover {
    background: #e5e7eb;
    color: #374151;
}

.mobile-chip.active {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.mobile-chip.primary {
    background: #dbeafe;
    color: #1e40af;
}

.mobile-chip.primary.active {
    background: #3b82f6;
    color: #ffffff;
}

/* ===================================
   MOBILE BUTTONS
   =================================== */

.mobile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    gap: 8px;
}

.mobile-btn:active {
    transform: scale(0.95);
}

.mobile-btn-primary {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.mobile-btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

.mobile-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.mobile-btn-secondary:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.mobile-btn-success {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.mobile-btn-success:hover {
    background: #059669;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

/* ===================================
   MOBILE TEST ATTEMPT OPTIMIZATIONS
   =================================== */

.mobile-test-attempt {
    padding: 16px;
    background: #ffffff;
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mobile-question-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.mobile-option {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f9fafb;
    border: 2px solid transparent;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-option:hover {
    background: #f3f4f6;
}

.mobile-option.selected {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
}

.mobile-option.correct {
    background: #dcfce7;
    border-color: #10b981;
    color: #065f46;
}

.mobile-option.incorrect {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.mobile-option input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.2);
}

/* ===================================
   MOBILE RESULT OPTIMIZATIONS
   =================================== */

.mobile-result-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mobile-score-display {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 16px;
    color: #ffffff;
    margin-bottom: 20px;
}

.mobile-score-value {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.mobile-score-label {
    font-size: 1rem;
    opacity: 0.9;
}

.mobile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.mobile-stat {
    text-align: center;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
}

.mobile-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 4px;
}

.mobile-stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

/* ===================================
   MOBILE NAVIGATION ENHANCEMENTS
   =================================== */

/* Ensure proper spacing for bottom navigation */
body.mobile-native-body {
    padding-bottom: 0;
}

/* Mobile navigation auto-hide during test attempts */
.mobile-nav-container {
    transition: all 0.3s ease;
}

.mobile-nav-container.hidden {
    transform: translateY(100%);
    opacity: 0;
}

/* ===================================
   RESPONSIVE ADJUSTMENTS
   =================================== */

@media (max-width: 575.98px) {
    .mobile-test-details {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .mobile-stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .mobile-test-card .card-body {
        padding: 16px;
    }
    
    .mobile-question-card {
        padding: 16px;
    }
    
    .mobile-result-card {
        padding: 16px;
    }
}

@media (min-width: 768px) {
    .mobile-bottom-nav {
        display: none !important;
    }
    
    .mobile-container {
        padding-bottom: 0;
    }
}

/* ===================================
   ACCESSIBILITY IMPROVEMENTS
   =================================== */

@media (prefers-reduced-motion: reduce) {
    .mobile-test-card,
    .mobile-option,
    .mobile-btn,
    .mobile-chip {
        transition: none;
    }
    
    .mobile-test-card:active,
    .mobile-btn:active {
        transform: none;
    }
}

@media (prefers-color-scheme: dark) {
    .mobile-container {
        background: #111827;
    }
    
    .mobile-test-card,
    .mobile-result-card,
    .mobile-question-card {
        background: #1f2937;
        border-color: #374151;
    }
    
    .mobile-test-card .card-title {
        color: #f9fafb;
    }
    
    .mobile-test-card .card-text {
        color: #d1d5db;
    }
    
    .mobile-search {
        background: #374151;
        border-color: #4b5563;
    }
    
    .mobile-search:focus-within {
        border-color: #60a5fa;
        background: #1f2937;
    }
    
    .native-input {
        color: #f9fafb;
    }
    
    .mobile-chip {
        background: #374151;
        color: #d1d5db;
    }
    
    .mobile-chip:hover {
        background: #4b5563;
        color: #f9fafb;
    }
    
    .mobile-option {
        background: #374151;
        color: #f9fafb;
    }
    
    .mobile-option:hover {
        background: #4b5563;
    }
}

/* ===================================
   PERFORMANCE OPTIMIZATIONS
   =================================== */

.mobile-test-card,
.mobile-option,
.mobile-btn {
    will-change: transform;
}

.mobile-test-card:active,
.mobile-option:active,
.mobile-btn:active {
    will-change: auto;
}

/* Optimize for mobile performance */
* {
    -webkit-tap-highlight-color: transparent;
}

.mobile-option,
.mobile-btn,
.mobile-chip {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
