/**
 * Test Series Mobile CSS
 * Native mobile app experience for test series page
 * Version: 2.0.0
 */

/* ===================================
   MOBILE CONTAINER & LAYOUT
   =================================== */

.mobile-container {
    padding: 16px;
    padding-bottom: 100px; /* Space for bottom navigation */
    max-width: 100%;
    margin: 0 auto;
}

/* ===================================
   MOBILE SEARCH COMPONENTS
   =================================== */

.mobile-search-container {
    margin-bottom: 20px;
}

.mobile-search {
    position: relative;
    margin-bottom: 16px;
}

.mobile-search .native-input {
    padding-left: 48px;
    padding-right: 48px;
    font-size: 16px; /* Prevent zoom on iOS */
    border-radius: 16px;
    border: 2px solid #e5e7eb;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.mobile-search .native-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 2px 8px rgba(0, 0, 0, 0.12);
}

.mobile-search .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 18px;
    pointer-events: none;
}

.mobile-search .clear-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mobile-search input:not(:placeholder-shown) + .search-icon + .clear-icon {
    opacity: 1;
}

/* ===================================
   MOBILE FILTER CHIPS
   =================================== */

.mobile-filter-chips {
    margin-bottom: 24px;
}

.chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.mobile-chip {
    display: inline-flex;
    align-items: center;
    background: #f3f4f6;
    color: #6b7280;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    min-height: 36px;
    touch-action: manipulation;
}

.mobile-chip:active {
    transform: scale(0.95);
}

.mobile-chip.active,
.mobile-chip.primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.mobile-sort-options {
    margin-top: 12px;
}

.mobile-sort-options .native-select {
    width: 100%;
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 12px;
}

/* ===================================
   MOBILE SECTIONS
   =================================== */

.mobile-section {
    margin-bottom: 32px;
}

.mobile-section-header {
    margin-bottom: 20px;
}

.mobile-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}

.mobile-section-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* ===================================
   MOBILE TEST GRID
   =================================== */

.mobile-test-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .mobile-test-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .mobile-test-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===================================
   MOBILE TEST CARDS
   =================================== */

.mobile-test-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    overflow: hidden;
    border: 1px solid #f3f4f6;
}

.mobile-test-card:active {
    transform: scale(0.98);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.mobile-test-card .native-card-header {
    padding: 20px 20px 0 20px;
    border-bottom: none;
}

.mobile-test-card .native-card-body {
    padding: 16px 20px;
}

.mobile-test-card .native-card-footer {
    padding: 0 20px 20px 20px;
    border-top: 1px solid #f3f4f6;
}

.mobile-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    line-height: 1.3;
}

.mobile-card-description {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

/* ===================================
   MOBILE BADGES
   =================================== */

.mobile-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-badge.featured {
    background: #fef3c7;
    color: #d97706;
}

.mobile-badge.complete {
    background: #dbeafe;
    color: #2563eb;
}

/* ===================================
   MOBILE TEST STATS
   =================================== */

.mobile-test-stats {
    display: flex;
    gap: 16px;
    margin: 12px 0;
}

.mobile-stat {
    text-align: center;
    flex: 1;
}

.mobile-stat .stat-number {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #3b82f6;
    line-height: 1;
}

.mobile-stat .stat-label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ===================================
   MOBILE PRICING & CATEGORY
   =================================== */

.mobile-price {
    font-size: 18px;
    font-weight: 700;
    color: #059669;
    display: block;
}

.mobile-category {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
    display: block;
}

/* ===================================
   MOBILE EMPTY STATE
   =================================== */

.mobile-empty-state {
    padding: 40px 20px;
}

.mobile-empty-state .native-card {
    background: #f9fafb;
    border: 2px dashed #d1d5db;
}

.mobile-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.mobile-empty-description {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* ===================================
   MOBILE ANIMATIONS
   =================================== */

@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-bottom {
    animation: slideInBottom 0.3s ease-out;
}

/* ===================================
   RESPONSIVE ADJUSTMENTS
   =================================== */

@media (max-width: 480px) {
    .mobile-container {
        padding: 12px;
    }
    
    .mobile-test-card .native-card-header,
    .mobile-test-card .native-card-body,
    .mobile-test-card .native-card-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .mobile-test-card .native-card-header {
        padding-top: 16px;
    }
    
    .mobile-test-card .native-card-footer {
        padding-bottom: 16px;
    }
    
    .mobile-section-title {
        font-size: 18px;
    }
    
    .mobile-card-title {
        font-size: 15px;
    }
    
    .mobile-test-stats {
        gap: 12px;
    }
    
    .mobile-stat .stat-number {
        font-size: 16px;
    }
    
    .mobile-price {
        font-size: 16px;
    }
}

/* ===================================
   DARK MODE SUPPORT
   =================================== */

@media (prefers-color-scheme: dark) {
    .mobile-container {
        background: #111827;
    }
    
    .mobile-test-card {
        background: #1f2937;
        border-color: #374151;
    }
    
    .mobile-card-title {
        color: #f9fafb;
    }
    
    .mobile-card-description {
        color: #9ca3af;
    }
    
    .mobile-section-title {
        color: #f9fafb;
    }
    
    .mobile-section-subtitle {
        color: #9ca3af;
    }
    
    .mobile-search .native-input {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .mobile-search .native-input:focus {
        border-color: #3b82f6;
    }
    
    .mobile-chip {
        background: #374151;
        color: #9ca3af;
    }
    
    .mobile-chip.active,
    .mobile-chip.primary {
        background: #3b82f6;
        color: white;
    }
    
    .mobile-empty-state .native-card {
        background: #1f2937;
        border-color: #374151;
    }
    
    .mobile-empty-title {
        color: #f9fafb;
    }
    
    .mobile-empty-description {
        color: #9ca3af;
    }
}

/* ===================================
   ACCESSIBILITY ENHANCEMENTS
   =================================== */

@media (prefers-reduced-motion: reduce) {
    .mobile-test-card,
    .mobile-chip,
    .mobile-search .native-input {
        transition: none;
    }
    
    .slide-in-bottom {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .mobile-test-card {
        border-width: 2px;
        border-color: #000;
    }
    
    .mobile-search .native-input {
        border-width: 2px;
    }
    
    .mobile-chip {
        border-width: 2px;
    }
}

/* ===================================
   TEST SERIES START PAGE MOBILE OPTIMIZATION
   =================================== */

.mobile-optimized {
    padding-bottom: 100px; /* Space for enhanced bottom nav */
}

/* Hide footer on mobile for native app experience */
.mobile-optimized .d-none.d-md-block {
    display: none !important;
}

@media (max-width: 767.98px) {
    .mobile-optimized .d-none.d-md-block {
        display: none !important;
    }
}

.mobile-hero-section {
    padding: 2rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.mobile-hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.mobile-test-details {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
}

.mobile-instructions-card,
.mobile-action-card {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
    background: white;
}

.mobile-instructions-card .card-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    border: none;
    padding: 20px;
}

.mobile-action-card .card-header {
    border: none;
    padding: 20px;
}

.mobile-container {
    padding: 20px;
    max-width: 100%;
}

/* Mobile-specific button enhancements */
.native-button {
    min-height: 52px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 16px;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.native-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.native-button:active::before {
    left: 100%;
}

.native-button.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.native-button.primary:active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Mobile breadcrumb optimization */
.mobile-hero-section .breadcrumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 8px 16px;
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
}

.mobile-hero-section .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none;
    font-size: 14px;
}

.mobile-hero-section .breadcrumb-item.active {
    color: white !important;
    font-weight: 600;
}

/* Mobile typography optimization */
.mobile-hero-section h1 {
    font-size: 28px;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-hero-section .lead {
    font-size: 16px;
    opacity: 0.9;
}

/* Mobile badge enhancements */
.mobile-hero-section .badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile stats grid optimization */
.mobile-test-details .row {
    gap: 8px;
}

.mobile-test-details .col-4 {
    padding: 12px 8px;
    text-align: center;
}

.mobile-test-details .h4 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.mobile-test-details small {
    font-size: 11px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile instructions list optimization */
.mobile-instructions-card .list-unstyled li {
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.mobile-instructions-card .list-unstyled li:last-child {
    border-bottom: none;
}

.mobile-instructions-card .list-unstyled li i {
    margin-top: 2px;
    flex-shrink: 0;
}

/* Mobile action card enhancements */
.mobile-action-card .alert {
    border: none;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}

.mobile-action-card .alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.mobile-action-card .alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.mobile-action-card .alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .mobile-container {
        padding: 16px;
    }
    
    .mobile-hero-section {
        padding: 1.5rem 0;
    }
    
    .mobile-hero-section h1 {
        font-size: 24px;
    }
    
    .mobile-hero-section .lead {
        font-size: 14px;
    }
    
    .mobile-test-details .h4 {
        font-size: 20px;
    }
    
    .native-button {
        min-height: 48px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .mobile-container {
        padding: 12px;
    }
    
    .mobile-hero-section {
        padding: 1rem 0;
    }
    
    .mobile-hero-section h1 {
        font-size: 20px;
    }
    
    .mobile-test-details .h4 {
        font-size: 18px;
    }
    
    .native-button {
        min-height: 44px;
        font-size: 14px;
    }
}