/* ══════════════════════════════════════════════════════════════
   LAYOUT SYSTEM - Focus & Classic Modes
   PilotPrep ATPL Labs
   ══════════════════════════════════════════════════════════════ */

/* === BASE TRANSITIONS === */
.main-grid,
.main-grid > * {
    transition: all 0.3s ease;
}

/* ══════════════════════════════════════════════════════════════
   CLASSIC MODE (Dashboard Style)
   - Sidebar gauche fixe (350px) + zone principale fluide
   - Tout visible en même temps
   ══════════════════════════════════════════════════════════════ */

body.classic-mode .main-grid {
    display: grid !important;
    grid-template-columns: 350px 1fr !important;
    grid-template-rows: auto 1fr auto !important;
    gap: 2rem !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
}

body.classic-mode .controls-section {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 100% !important;
    max-width: none !important;
}

body.classic-mode .viz-section {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    width: 100% !important;
    max-width: none !important;
}

body.classic-mode .results-section {
    /* En mode classique, les résultats sont dans la sidebar controls */
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    order: 0 !important;
}

body.classic-mode .theory-section {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    width: 100% !important;
    max-width: none !important;
}

/* Classic: Tailles et styles */
body.classic-mode .big-number {
    font-size: 1.75rem !important;
    font-weight: 700;
}

body.classic-mode .step-badge {
    display: none !important;
}

body.classic-mode .result-highlight {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

/* ══════════════════════════════════════════════════════════════
   FOCUS MODE (Step by Step)
   - Colonne unique centrée (max 800px)
   - Blocs empilés verticalement
   - Résultat principal en premier
   ══════════════════════════════════════════════════════════════ */

body.focus-mode .main-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
    max-width: 800px !important;
    margin: 0 auto !important;
}

body.focus-mode .main-grid > * {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

/* Focus: Ordre des sections */
body.focus-mode .results-section {
    order: -10 !important;
}

body.focus-mode .controls-section {
    order: -5 !important;
}

body.focus-mode .viz-section {
    order: 0 !important;
}

body.focus-mode .theory-section {
    order: 10 !important;
}

/* Focus: Section Résultat Principal */
body.focus-mode .results-section {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    padding: 2rem;
    border-radius: 1.5rem;
    text-align: center;
    box-shadow: 0 10px 25px -5px rgba(14, 165, 233, 0.3);
}

body.focus-mode .results-section .result-label {
    opacity: 0.9;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Focus: Gros chiffres */
body.focus-mode .big-number {
    font-size: 3.5rem !important;
    font-weight: 800;
    line-height: 1;
    margin: 0.5rem 0;
}

/* Focus: Badges étapes */
body.focus-mode .step-badge {
    display: inline-flex !important;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #0ea5e9;
    color: white;
    font-weight: 700;
    font-size: 14px;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* Focus: Sections avec bordure */
body.focus-mode .controls-section,
body.focus-mode .viz-section,
body.focus-mode .theory-section {
    background: white;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Focus: Section headers */
body.focus-mode .section-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

body.focus-mode .section-title {
    font-weight: 700;
    color: #0f172a;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    body.classic-mode .main-grid {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
    }

    body.classic-mode .controls-section,
    body.classic-mode .viz-section,
    body.classic-mode .results-section,
    body.classic-mode .theory-section {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
}

@media (max-width: 640px) {
    body.focus-mode .big-number {
        font-size: 2.5rem !important;
    }

    body.focus-mode .main-grid {
        gap: 1rem !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   LAYOUT TOGGLE BUTTON
   ══════════════════════════════════════════════════════════════ */

.layout-toggle {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: #f1f5f9;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
}

.layout-toggle button {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: #64748b;
}

.layout-toggle button:hover:not(.active) {
    color: #0f172a;
    background: #e2e8f0;
}

.layout-toggle button.active {
    background: #0ea5e9;
    color: white;
    box-shadow: 0 2px 4px rgba(14, 165, 233, 0.3);
}

.layout-toggle button svg {
    width: 16px;
    height: 16px;
}

/* ══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ══════════════════════════════════════════════════════════════ */

/* Hide in focus mode */
.hide-focus {
    /* Will be hidden in focus mode */
}
body.focus-mode .hide-focus {
    display: none !important;
}

/* Hide in classic mode */
.hide-classic {
    /* Will be hidden in classic mode */
}
body.classic-mode .hide-classic {
    display: none !important;
}

/* Show only in focus */
.show-focus-only {
    display: none !important;
}
body.focus-mode .show-focus-only {
    display: block !important;
}

/* Show only in classic */
.show-classic-only {
    display: none !important;
}
body.classic-mode .show-classic-only {
    display: block !important;
}

/* Result card animation */
@keyframes pulse-result {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

body.focus-mode .results-section.pulse {
    animation: pulse-result 0.3s ease-in-out;
}
