/**
 * ═══════════════════════════════════════════════════════════════
 * QUIZ MODERN - MOBILE CSS
 * ═══════════════════════════════════════════════════════════════
 * Optimizări responsive pentru dispozitive mobile
 */

/* ═══════════════════════════════════════════════════════════════
   BREAKPOINTS:
   - xs: 0 - 480px (telefoane mici)
   - sm: 481px - 640px (telefoane mari)
   - md: 641px - 768px (tablete portrait)
   - lg: 769px - 1024px (tablete landscape)
   - xl: 1025px+ (desktop)
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   TABLETE LANDSCAPE (max-width: 1024px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .mode-cards {
        gap: var(--space-lg);
    }
    
    .card-image {
        height: 180px;
    }
    
    .selection-area {
        gap: var(--space-md);
    }
    
    .selection-column {
        max-height: 350px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   TABLETE PORTRAIT (max-width: 768px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Base adjustments */
    html {
        font-size: 15px;
    }
    
    .mode-screen,
    .content-screen {
        padding: var(--space-md);
    }
    
    /* Mode cards - stack vertical */
    .mode-cards {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
        max-width: 400px;
        margin: 0 auto;
    }
    
    .mode-card {
        border-radius: var(--radius-xl);
    }
    
    .card-image {
        height: 160px;
    }
    
    .card-info {
        padding: var(--space-md);
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .card-features {
        display: none; /* Hide on mobile for cleaner look */
    }
    
    /* Mode title */
    .mode-title {
        font-size: 1.5rem;
        margin-bottom: var(--space-xl);
    }
    
    /* Splash screen */
    .logo-text {
        font-size: 2rem;
    }
    
    .logo-icon {
        font-size: 3rem;
    }
    
    .splash-features {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .feature-item {
        width: 100%;
        justify-content: center;
    }
    
    .skip-btn {
        bottom: var(--space-lg);
        right: var(--space-lg);
    }
    
    /* Content selector - vertical stack */
    .selection-area {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .selection-column {
        max-height: 200px;
    }
    
    .progress-steps {
        transform: scale(0.9);
    }
    
    .step-connector {
        width: 40px;
    }
    
    /* Summary */
    .summary-info {
        flex-wrap: wrap;
    }
    
    .summary-count {
        width: 100%;
        text-align: center;
        margin-top: var(--space-sm);
    }
    
    /* Buttons */
    .content-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        padding: var(--space-lg);
        margin: var(--space-md);
    }
}

/* ═══════════════════════════════════════════════════════════════
   TELEFOANE MARI (max-width: 640px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
    html {
        font-size: 14px;
    }
    
    .mode-screen,
    .content-screen {
        padding: var(--space-sm);
    }
    
    /* Mode cards */
    .mode-cards {
        max-width: 100%;
    }
    
    .mode-card {
        border-radius: var(--radius-lg);
    }
    
    .card-image {
        height: 140px;
    }
    
    /* Splash */
    .logo-text {
        font-size: 1.75rem;
    }
    
    .splash-subtitle .typing-text {
        font-size: 1rem;
    }
    
    /* Content selector */
    .column-title {
        font-size: 0.875rem;
    }
    
    .selection-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
        gap: var(--space-xs);
    }
    
    .selection-item {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.875rem;
    }
    
    /* Progress steps - horizontal scroll */
    .progress-steps {
        transform: scale(0.8);
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
    
    .step-label {
        font-size: 0.625rem;
    }
    
    /* Quiz options */
    .quiz-options {
        flex-direction: column;
        gap: var(--space-sm);
    }
}

/* ═══════════════════════════════════════════════════════════════
   TELEFOANE MICI (max-width: 480px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
    
    /* Mode title */
    .mode-title {
        font-size: 1.25rem;
    }
    
    /* Cards */
    .card-image {
        height: 120px;
    }
    
    .card-title {
        font-size: 1.125rem;
    }
    
    .card-description {
        font-size: 0.75rem;
    }
    
    /* Splash */
    .logo-text {
        font-size: 1.5rem;
    }
    
    .logo-icon {
        font-size: 2.5rem;
    }
    
    .logo-badge {
        font-size: 0.75rem;
        padding: 2px var(--space-sm);
    }
    
    /* Content */
    .selection-column {
        max-height: 180px;
        padding: var(--space-sm);
    }
    
    .selection-summary {
        padding: var(--space-md);
    }
    
    /* Buttons */
    .btn-primary,
    .btn-secondary {
        padding: var(--space-sm) var(--space-lg);
        font-size: 0.875rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   LANDSCAPE MODE PE TELEFOANE
   ═══════════════════════════════════════════════════════════════ */

@media (max-height: 500px) and (orientation: landscape) {
    .splash-screen {
        padding: var(--space-sm);
    }
    
    .splash-content {
        transform: scale(0.8);
    }
    
    .splash-features {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .mode-screen {
        overflow-y: auto;
    }
    
    .mode-cards {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
    }
    
    .card-image {
        height: 100px;
    }
    
    .content-screen {
        overflow-y: auto;
    }
    
    .selection-area {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .selection-column {
        max-height: 150px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   TOUCH OPTIMIZATIONS
   ═══════════════════════════════════════════════════════════════ */

@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .selection-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .btn-primary,
    .btn-secondary {
        min-height: 48px;
    }
    
    .skip-btn {
        min-height: 44px;
        padding: var(--space-sm) var(--space-xl);
    }
    
    .modal-close {
        width: 44px;
        height: 44px;
    }
    
    .select-all-btn {
        min-height: 36px;
        padding: var(--space-sm) var(--space-md);
    }
    
    /* Remove hover effects that don't work on touch */
    .mode-card:hover {
        transform: none;
    }
    
    .mode-card:active {
        transform: scale(0.98);
    }
    
    .hover-lift:hover {
        transform: none;
    }
    
    .hover-lift:active {
        transform: scale(0.98);
    }
    
    /* Card selection indicator always visible on mobile */
    .card-select-indicator {
        opacity: 0.7;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════════
   SAFE AREA INSETS (pentru notch-uri iPhone, etc.)
   ═══════════════════════════════════════════════════════════════ */

@supports (padding: max(0px)) {
    .splash-screen,
    .mode-screen,
    .content-screen,
    .quiz-screen,
    .results-screen {
        padding-top: max(var(--space-md), env(safe-area-inset-top));
        padding-bottom: max(var(--space-md), env(safe-area-inset-bottom));
        padding-left: max(var(--space-md), env(safe-area-inset-left));
        padding-right: max(var(--space-md), env(safe-area-inset-right));
    }
    
    .skip-btn {
        bottom: max(var(--space-lg), calc(env(safe-area-inset-bottom) + var(--space-sm)));
        right: max(var(--space-lg), calc(env(safe-area-inset-right) + var(--space-sm)));
    }
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE ADJUSTMENTS
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
    /* Already dark theme, but can add adjustments if needed */
}

/* ═══════════════════════════════════════════════════════════════
   HIGH CONTRAST MODE
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-contrast: high) {
    .mode-card,
    .selection-column,
    .selection-summary {
        border-width: 2px;
    }
    
    .selection-item.selected {
        outline: 2px solid white;
        outline-offset: 2px;
    }
    
    .btn-primary {
        border: 2px solid white;
    }
}

/* ═══════════════════════════════════════════════════════════════
   PRINT STYLES (în caz că cineva printează)
   ═══════════════════════════════════════════════════════════════ */

@media print {
    .splash-screen,
    .loading-screen {
        display: none !important;
    }
    
    .vanta-bg,
    .gradient-bg-fallback {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}