/* ======================================================= */
/* --- VARIABLES ET RÉINITIALISATION --- */
/* ======================================================= */

:root {
    --bg-main: #0f172a; /* Slate 900 */
    --bg-card: #1e293b; /* Slate 800 */
    --bg-elevated: #334155; /* Slate 700 */
    --text-main: #f8fafc; /* Slate 50 */
    --text-muted: #94a3b8; /* Slate 400 */
    --text-subtle: #64748b; /* Slate 500 */
    --accent-1: #38bdf8; /* Sky 400 - Bleu */
    --accent-2: #a78bfa; /* Violet 400 - Violet */
    --accent-3: #f97316; /* Orange 600 - Orange */
    --border-color: rgba(56, 189, 248, 0.2);
    --font-sans: 'Inter', sans-serif;

    /* Espacements (Mobile-First) */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Rayons */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* Réinitialisation de base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent-1);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-2);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Animations Keyframes */
@keyframes mythoPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(56, 189, 248, 0);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wiggle {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(-5%, -5%);
    }
}

/* ======================================================= */
/* --- STRUCTURE GLOBALE --- */
/* ======================================================= */

.shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* HEADER */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
    margin-bottom: var(--space-xl);
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* FIX: Ajout du padding horizontal pour décoller le logo sur PC */
@media (min-width: 769px) {
    .header {
        padding-left: var(--space-2xl); 
        padding-right: var(--space-2xl);
    }
    
    .shell {
        padding: 0 var(--space-2xl);
    }
}


.brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.logo-mark {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
    transition: transform 0.3s ease;
}

.logo-mark:hover {
    transform: scale(1.05) rotate(5deg);
}

.logo-face {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-eyes {
    font-size: 1.8rem;
    animation: wiggle 4s infinite ease-in-out;
}

.logo-title {
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1;
    margin: 0;
}

.accent {
    color: var(--accent-1);
    font-weight: 300;
}

.mytho-text {
    color: var(--text-main);
}

.logo-tagline {
    font-size: 0.75rem;
    color: var(--text-subtle);
    margin-top: 0.2rem;
    line-height: 1;
}

/* NAVIGATION */
.nav {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 600;
    padding: var(--space-sm) 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap; /* Empêche le wrap sur PC */
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-1);
    border-bottom-color: var(--accent-1);
}

/* MAIN CONTENT */
.main {
    padding-bottom: var(--space-2xl);
}

/* HERO SECTION (INDEX) */
.hero {
    text-align: center;
    padding: var(--space-xl) 0 var(--space-2xl);
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: var(--space-md);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* CONTENT GRID (INDEX) */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
}

@media (min-width: 1024px) {
    .content-grid {
        grid-template-columns: 2fr 1fr;
        gap: var(--space-2xl);
    }
}

/* CARDS */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.card-header {
    margin-bottom: var(--space-lg);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--accent-1);
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-subtle);
}

/* INPUT FORM */
.mytho-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.input-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: var(--space-sm);
    display: block;
}

.mytho-input {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-elevated);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.3s ease;
}

.mytho-input:focus {
    outline: none;
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.mytho-input::placeholder {
    color: var(--text-subtle);
}

.input-footer {
    display: flex;
    justify-content: flex-end;
}

.char-counter {
    font-size: 0.85rem;
    color: var(--text-subtle);
    font-family: monospace;
}

.controls {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
    color: var(--bg-main);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.6);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-main);
    border-color: var(--accent-1);
    transform: translateY(-1px);
}

.btn-small {
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.85rem;
}

/* GÉNÉRATEUR */
.generator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.generator-header .card-title {
    color: var(--accent-2);
}

.generator-subtitle {
    font-size: 0.9rem;
    color: var(--text-subtle);
    margin-bottom: var(--space-md);
}

.generated-phrase {
    background: rgba(167, 139, 250, 0.08);
    border-left: 3px solid var(--accent-2);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    font-style: italic;
    color: var(--text-main);
    line-height: 1.5;
    min-height: 40px;
}

/* COMPTEUR USAGE */
.usage-card {
    border-color: rgba(167, 139, 250, 0.3);
}

.usage-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.usage-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.usage-label {
    font-size: 0.8rem;
    color: var(--text-subtle);
    font-weight: 600;
}

.usage-value {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1;
    color: var(--accent-1);
}

.usage-grade {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-1);
    margin-top: 0.25rem;
}

.usage-note {
    font-size: 0.75rem;
    color: var(--text-subtle);
}

/* RESULT CARD */
.result-card {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.05), rgba(167, 139, 250, 0.05));
    border-color: rgba(56, 189, 248, 0.3);
}

.result-card.hidden {
    display: none;
}

/* ZONE DE CAPTURE POUR PARTAGE */
.share-capture {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    border: 1px solid var(--border-color);
}

/* PHRASE ANALYSÉE (dans la capture) */
.share-phrase {
    background: rgba(56, 189, 248, 0.08);
    border-left: 3px solid var(--accent-1);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
    font-style: italic;
    max-width: 100%;
    word-wrap: break-word;
    line-height: 1.5;
}

/* JAUGE */
.gauge-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: var(--space-xl) 0;
}

.gauge {
    width: 100%;
    max-width: 280px;
}

.gauge-score {
    font-size: 3rem;
    font-weight: 900;
    fill: var(--text-main);
}

.gauge-label {
    font-size: 0.9rem;
    fill: var(--text-subtle);
}

/* VERDICT */
.result-text {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
}

/* BRANDING DE PARTAGE */
.share-branding {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    font-size: 0.8rem;
    color: var(--text-subtle);
}

/* ALERTE SPÉCIALE */
.alert {
    padding: var(--space-md);
    background: rgba(249, 115, 22, 0.1); /* Orange */
    border: 1px solid var(--accent-3);
    border-radius: var(--radius-md);
    margin-top: var(--space-lg);
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--accent-3);
}

.alert.hidden {
    display: none;
}

/* ZONE DE PARTAGE */
.share-section {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px dashed var(--border-color);
}

.share-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: var(--space-md);
    text-align: center;
}

.share-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
    background: var(--bg-elevated);
    color: var(--text-main);
}

.btn-share:hover {
    transform: translateY(-2px);
    border-color: var(--accent-1);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

.share-feedback {
    text-align: center;
    font-size: 0.85rem;
    margin-top: var(--space-md);
    color: var(--accent-1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* DISCLAIMER */
.disclaimer {
    margin-top: var(--space-2xl);
    padding: var(--space-xl) var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.disclaimer-content {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.disclaimer-icon {
    font-size: 1.5rem;
    color: var(--accent-3);
    flex-shrink: 0;
}

.disclaimer-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* FOOTER */
.footer {
    padding: var(--space-xl) 0 var(--space-md);
    margin-top: var(--space-2xl);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
}

.footer-brand {
    margin-bottom: var(--space-lg);
}

.footer-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.footer-title {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1;
}

.footer-tagline {
    font-size: 0.7rem;
    color: var(--text-subtle);
    margin-top: 0.2rem;
}

.footer-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.btn-support {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    margin: var(--space-lg) 0;
    background: #FFDD00; /* Coffee yellow */
    color: #3C2A21;
    font-weight: 700;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(255, 221, 0, 0.5);
}

.btn-support:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 221, 0, 0.7);
}

.footer-links {
    margin-top: var(--space-md);
    font-size: 0.9rem;
    color: var(--text-subtle);
}

.footer-links a {
    color: var(--text-muted);
    transition: color 0.3s ease;
    padding: 0 var(--space-sm);
}

.footer-links a:hover {
    color: var(--accent-1);
}

.separator {
    color: var(--text-subtle);
}

.footer-note,
.footer-legal,
.version-tag {
    font-size: 0.8rem;
    color: var(--text-subtle);
    margin-top: var(--space-md);
}

.note-icon {
    margin-right: var(--space-xs);
    color: var(--accent-1);
}

/* ======================================================= */
/* --- STYLES SPÉCIFIQUES PAGES FAQ & ABOUT --- */
/* ======================================================= */

/* Images FAQ/About (Correction de la hauteur sur PC) */
.page-hero img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: var(--space-xl) auto; /* Centre l'image */
    border-radius: var(--radius-lg);
}

/* Constraint pour les grandes illustrations (PC uniquement) */
.faq-hero-illustration img,
.about-hero-illustration img {
    max-height: 400px; 
    object-fit: contain;
}

.page-title {
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: var(--space-md);
    line-height: 1.2;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto var(--space-2xl);
    text-align: center;
}

.faq-item {
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-color);
}

.faq-question {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-1);
    margin-bottom: var(--space-sm);
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.faq-answer {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    padding-left: 2rem;
}

.about-section h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-lg);
    color: var(--accent-2);
}

.about-section p {
    margin-bottom: var(--space-lg);
    color: var(--text-muted);
}

/* ======================================================= */
/* --- STYLES 404 --- */
/* ======================================================= */

.error-container {
    display: flex;
    flex-direction: column;
    align-items: center; 
    text-align: center;
    min-height: 80vh; 
    justify-content: center;
    padding: var(--space-xl);
}

.error-code {
    font-size: 6rem;
    font-weight: 900;
    color: var(--accent-3);
    margin-bottom: var(--space-md);
    line-height: 1;
}

.error-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: var(--space-xl);
    color: var(--text-main);
}

/* ======================================================= */
/* --- MEDIA QUERIES (MOBILE FIXES) --- */
/* ======================================================= */

@media (max-width: 768px) {
    
    /* Réduction du padding général du shell sur mobile */
    .shell {
        padding: 0 var(--space-md);
    }
    
    /* HEADER (Mobile Stack) */
    .header {
        flex-direction: column; 
        padding-left: var(--space-md); 
        padding-right: var(--space-md);
        gap: var(--space-md);
    }
    
    /* FIX CRUCIAL MENU MOBILE (iOS) */
    .nav {
        flex-wrap: nowrap; /* Empêche le retour à la ligne */
        justify-content: space-between; /* Distribue l'espace */
        width: 100%;
        gap: var(--space-xs); /* Réduction de l'espace */
    }
    
    .nav-link {
        font-size: 0.8rem; /* Réduction de la taille de police */
        padding: var(--space-sm) var(--space-xs);
    }

    /* CONTENT GRID (Index) */
    .content-grid {
        gap: var(--space-xl);
    }

    /* HERO SECTION */
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    /* CARD (Index) */
    .card {
        padding: var(--space-lg);
    }
    
    .controls, .share-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn, .btn-share {
        width: 100%;
    }
    
    /* GÉNÉRATEUR */
    .generator-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-md);
    }
    
    .btn-small {
        width: 100%;
    }
    
    /* JAUGE */
    .gauge {
        max-width: 220px;
    }
    
    .gauge-score {
        font-size: 2.5rem;
    }
    
    /* Images FAQ/About (Suppression de la contrainte de hauteur sur mobile) */
    .faq-hero-illustration img,
    .about-hero-illustration img {
        max-height: none; 
        margin: var(--space-lg) auto;
    }
    
    /* FAQ/ABOUT LAYOUT */
    .page-title {
        font-size: 1.75rem;
    }
    
    .page-subtitle {
        font-size: 0.95rem;
    }
    
    .faq-answer {
        padding-left: 1rem;
    }
    
    /* FOOTER */
    .footer-links {
        display: flex;
        flex-direction: column;
        gap: var(--space-xs);
    }
    
    .separator {
        display: none;
    }
}


/* --- Mise à jour de la classe générique des boutons de partage --- */
.btn-share {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.9rem; /* Légère augmentation de la taille pour plus de clarté */
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
    background: var(--bg-elevated);
    color: var(--text-main);
    flex-grow: 1; /* Permet aux boutons d'occuper l'espace disponible */
    max-width: 200px; /* Limite la largeur sur PC */
}

/* --- Style spécifique pour chaque média/action --- */

/* 1. Bouton "Image" (Capture / Branding Lemyto) */
.btn-share.capture {
    background: var(--accent-1); /* Bleu clair du thème Lemyto */
    color: var(--bg-main);
    border-color: var(--accent-1);
}
.btn-share.capture:hover {
    background: #50c9ff; 
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

/* 2. Bouton "WhatsApp" */
.btn-share.whatsapp {
    background-color: #25D366; /* Vert WhatsApp */
    color: white;
    border-color: #25D366;
}
.btn-share.whatsapp:hover {
    background-color: #1DA851;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

/* 3. Bouton "Lien" (Copie) */
.btn-share.copy-link {
    background: var(--bg-card); /* Reste sobre */
    color: var(--text-main);
    border-color: var(--text-subtle);
}
.btn-share.copy-link:hover {
    border-color: var(--accent-2);
    color: var(--accent-2);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(167, 139, 250, 0.2);
}

/* Correction mobile pour que les boutons s'étirent */
@media (max-width: 768px) {
    .share-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-share {
        max-width: none; /* Occupe toute la largeur sur mobile */
    }
}