/* ============================================
   SuperPONT - Original "Kerkito" Look
   ============================================ */

:root {
    /* Colors - The "Original" Palette */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: #15151f;
    
    --accent-primary: #00ff88;
    --accent-glow: rgba(0, 255, 136, 0.15);
    
    --text-primary: #e8e8ed;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    
    --border-color: #2a2a3a;
    
    /* Fonts */
    --font-mono: 'JetBrains Mono', monospace;
    --font-body: 'Space Grotesk', sans-serif;
    
    /* Spacing & Radius */
    --radius-md: 8px;
    --radius-lg: 12px;
    --max-width: 1200px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Grain Overlay (Subtle) */
.grain-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 999; opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Header */
.header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1rem;
}
.header-content {
    max-width: var(--max-width); margin: 0 auto; height: 70px;
    display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: white; }
.logo-symbol { color: var(--accent-primary); font-size: 1.5rem; font-weight: 700; }
.logo-text { font-family: var(--font-mono); font-weight: 600; font-size: 1.2rem; }
.logo-highlight { color: var(--accent-primary); }
.logo-subtitle { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--border-color); }

.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav-link { font-size: 0.9rem; color: var(--text-secondary); text-decoration: none; transition: 0.2s; }
.nav-link:hover { color: white; }
.nav-btn-icon {
    display: flex; align-items: center; gap: 8px;
    background: transparent; border: 1px solid var(--border-color);
    color: var(--text-secondary); padding: 6px 12px; border-radius: 6px;
    cursor: pointer; font-size: 0.8rem; font-family: var(--font-body);
}
.nav-btn-icon:hover { border-color: var(--accent-primary); color: white; }

/* Hero */
.hero { padding: 5rem 1rem; text-align: center; position: relative; }
.hero-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero-glow {
    position: absolute; top: 20%; left: 50%; transform: translateX(-50%);
    width: 600px; height: 600px; background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    filter: blur(80px); opacity: 0.6;
}
.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px; background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: 50px; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 2rem;
}
.badge-dot { width: 6px; height: 6px; background: var(--accent-primary); border-radius: 50%; }
.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 700; line-height: 1.1; margin-bottom: 1.5rem;
}
.text-highlight { color: var(--accent-primary); }
.text-gradient { background: linear-gradient(135deg, #fff 0%, #aaa 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { color: var(--text-secondary); font-size: 1.1rem; margin-bottom: 2.5rem; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 24px; border-radius: 8px; font-weight: 600; font-size: 0.95rem;
    text-decoration: none; cursor: pointer; transition: 0.2s; border: none;
}
.btn--primary {
    background: var(--accent-primary); color: #000;
}
.btn--primary:hover {
    background: #00cc6a; transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--accent-glow);
}
.btn--secondary {
    background: transparent; border: 1px solid var(--border-color); color: white;
}
.btn--secondary:hover { border-color: white; }

/* Analyzer Section */
.analyzer-section { padding: 2rem 1rem; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-tag { font-family: var(--font-mono); color: var(--accent-primary); font-size: 0.8rem; letter-spacing: 0.1em; display: block; margin-bottom: 0.5rem; }
.section-title { font-size: 2rem; font-weight: 700; }

.analyzer-container {
    max-width: var(--max-width); margin: 0 auto;
    display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
}

/* Panels */
.analyzer-panel {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); display: flex; flex-direction: column;
    min-height: 500px; overflow: hidden;
}
.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.5rem; background: var(--bg-tertiary); border-bottom: 1px solid var(--border-color);
}
.panel-title { font-family: var(--font-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); margin-left: 8px; }
.panel-icon { color: var(--accent-primary); }

/* Panel Actions (The specific buttons you liked) */
.panel-actions { display: flex; gap: 8px; }
.panel-action {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; background: var(--bg-secondary);
    border: 1px solid var(--border-color); border-radius: 6px;
    color: var(--text-secondary); cursor: pointer; transition: 0.2s;
}
.panel-action:hover { border-color: var(--accent-primary); color: var(--accent-primary); }

/* Tabs & Inputs */
.source-tabs { display: flex; padding: 1rem; border-bottom: 1px solid var(--border-color); gap: 10px; }
.source-tab {
    flex: 1; padding: 0.6rem; background: transparent; border: 1px solid transparent;
    border-radius: 6px; color: var(--text-secondary); cursor: pointer; font-size: 0.9rem;
    transition: 0.2s;
}
.source-tab:hover { background: var(--bg-tertiary); color: white; }
.source-tab.active { background: var(--bg-tertiary); border-color: var(--accent-primary); color: var(--accent-primary); }

.input-wrapper { padding: 1.5rem; flex: 1; }
.input-area { display: none; }
.input-area.active { display: block; animation: fadeIn 0.3s ease; }
label { display: block; margin-bottom: 0.5rem; font-size: 0.8rem; color: var(--text-secondary); }
.input-field {
    width: 100%; padding: 1rem; background: var(--bg-primary); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); color: var(--text-primary); font-family: var(--font-mono); font-size: 0.9rem;
    transition: 0.2s;
}
.input-field:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 2px rgba(0,255,136,0.1); }
textarea.input-field { min-height: 200px; resize: vertical; }

.context-section { padding: 0 1.5rem 1.5rem; }
.toggle-btn { background: none; border: 1px dashed var(--border-color); color: var(--text-muted); width: 100%; padding: 0.8rem; border-radius: var(--radius-md); cursor: pointer; transition: 0.2s; }
.toggle-btn:hover { border-color: var(--text-secondary); color: var(--text-secondary); }

.analyze-btn {
    margin: 1.5rem; padding: 1rem; width: calc(100% - 3rem);
    background: var(--accent-primary); border: none; border-radius: var(--radius-md);
    font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.05em;
    cursor: pointer; transition: 0.2s; display: block;
}
.analyze-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px var(--accent-glow); }

/* Output Area */
.output-content { padding: 1.5rem; flex: 1; overflow-y: auto; color: var(--text-secondary); }
.state-view { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.placeholder-icon { font-size: 3rem; color: var(--border-color); margin-bottom: 1rem; }
.loading-spinner {
    width: 40px; height: 40px; border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary); border-radius: 50%;
    animation: spin 1s linear infinite; margin-bottom: 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Result Markdown */
#result-state { font-family: var(--font-mono); font-size: 0.9rem; line-height: 1.7; color: #e0e0e0; }
#result-state h3 { color: var(--accent-primary); margin-top: 0; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; margin-bottom: 1rem; }
#result-state pre { background: black; padding: 1rem; border-radius: 6px; overflow-x: auto; border: 1px solid var(--border-color); margin: 1rem 0; }

/* Frameworks Grid */
.modes-section { padding: 3rem 1rem; max-width: var(--max-width); margin: 0 auto; }
.filter-bar { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2rem; }
.filter-btn { background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); padding: 0.5rem 1rem; border-radius: 50px; cursor: pointer; transition: 0.2s; }
.filter-btn.active, .filter-btn:hover { background: var(--bg-tertiary); color: white; border-color: var(--accent-primary); }

.modes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }
.mode-card {
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg);
    padding: 1.5rem; cursor: pointer; transition: 0.2s; position: relative;
}
.mode-card:hover { transform: translateY(-4px); border-color: var(--accent-primary); }
.mode-card.active { border-color: var(--accent-primary); background: rgba(0,255,136,0.03); }
.mode-icon { font-size: 2rem; margin-bottom: 1rem; display: block; }
.mode-title { font-weight: 700; margin-bottom: 0.5rem; font-family: var(--font-mono); }
.mode-desc { font-size: 0.85rem; color: var(--text-secondary); }

/* Contact & Footer */
.contact-section { padding: 4rem 1rem; text-align: center; background: var(--bg-secondary); margin-top: 4rem; }
.contact-box { max-width: 600px; margin: 0 auto; }
.contact-form { margin-top: 2rem; display: flex; flex-direction: column; gap: 1rem; }

.footer { padding: 3rem 1rem; border-top: 1px solid var(--border-color); font-size: 0.9rem; color: var(--text-muted); }
.footer-content { max-width: var(--max-width); margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer a { color: var(--text-primary); text-decoration: none; }

/* Sidebar History */
.sidebar {
    position: fixed; top: 0; right: 0; width: 320px; height: 100vh;
    background: var(--bg-primary); border-left: 1px solid var(--border-color);
    transform: translateX(100%); transition: 0.3s ease; z-index: 2000;
    display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(0,0,0,0.5);
}
.sidebar.open { transform: translateX(0); }
.sidebar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1500;
    opacity: 0; pointer-events: none; transition: 0.3s;
}
.sidebar.open + .sidebar-overlay, .sidebar-overlay.active { opacity: 1; pointer-events: auto; }

.sidebar-header { padding: 1.5rem; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.history-list { flex: 1; overflow-y: auto; padding: 1rem; }
.history-item { padding: 1rem; background: var(--bg-card); border-radius: 8px; margin-bottom: 0.5rem; cursor: pointer; border: 1px solid transparent; transition: 0.2s; }
.history-item:hover { border-color: var(--accent-primary); }
.sidebar-footer { padding: 1rem; border-top: 1px solid var(--border-color); text-align: center; }
.btn-text-danger { background: none; border: none; color: #ff5555; cursor: pointer; text-decoration: underline; }

.hidden { display: none !important; }

/* Mobile */
@media (max-width: 768px) {
    .analyzer-container { grid-template-columns: 1fr; }
    .hero-title { font-size: 2.2rem; }
    .footer-content { flex-direction: column; text-align: center; }
}



/* ============================================
   Footer Premium (Style Kachouri.com)
   ============================================ */

.site-footer {
    background-color: #050508; /* Fond très sombre */
    border-top: 1px solid var(--border-color);
    padding-top: 5rem;
    margin-top: 0;
    font-family: var(--font-body);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem 4rem 1.5rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr; /* La 1ère colonne (Brand) est plus large */
    gap: 4rem;
}

/* Colonne Branding */
.brand-col {
    max-width: 400px;
}

.footer-logo {
    font-family: var(--font-heading); /* ou Outfit */
    font-size: 2rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
    display: block;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.footer-tagline {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Réseaux sociaux (Style bouton carré sombre) */
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: white;
    transition: all 0.2s ease;
}

.social-icon:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: black;
    transform: translateY(-3px);
}

/* Colonnes de Liens */
.footer-heading {
    color: white;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.footer-links-list a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    display: block;
}

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

/* Descriptions sous les liens (Ex: "Comparateur IA Global") */
.link-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Footer Bottom (Copyright) */
.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    background-color: #020204;
}

.footer-bottom-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.made-with {
    opacity: 0.7;
}

/* Responsive Mobile */
@media (max-width: 900px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .brand-col {
        max-width: 100%;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
}



/* ============================================
   Pages Légales & 404
   ============================================ */

.legal-section {
    padding: 8rem 1rem 4rem; /* Padding top large pour compenser le header fixed */
    min-height: 80vh;
}

.legal-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.legal-title {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.legal-content h2 {
    color: var(--accent-primary);
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-family: var(--font-heading);
}

.legal-content p, .legal-content li {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

.legal-content ul {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.last-update {
    display: block;
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Page 404 */
.error-section {
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.error-code {
    font-size: 10rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #fff 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: var(--font-mono);
    opacity: 0.1;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.error-content {
    position: relative;
    z-index: 1;
}

.error-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.error-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .legal-container { padding: 1.5rem; }
    .legal-title { font-size: 1.8rem; }
}


/* ============================================
   CORRECTIF MOBILE (Responsive Header)
   ============================================ */

@media (max-width: 768px) {
    
    /* 1. Header plus compact */
    .header-content {
        height: 60px;
        padding: 0 1rem;
    }

    /* 2. Logo : On cache "by Kerkito" pour gagner de la place */
    .logo-subtitle {
        display: none;
    }

    /* 3. Menu : On cache les liens de navigation textuels */
    /* L'utilisateur peut scroller, on garde l'essentiel */
    .nav-link {
        display: none;
    }

    /* 4. Bouton Historique : Optimisé pour mobile */
    .nav-btn-icon {
        font-size: 0.75rem; /* Texte plus petit */
        padding: 6px 10px;  /* Moins de marge interne */
        white-space: nowrap; /* Empêche le texte de passer à la ligne */
    }

    /* 5. Ajustement Hero (Titre) pour éviter qu'il soit énorme */
    .hero {
        padding: 3rem 1rem;
    }
    .hero-title {
        font-size: 2rem; /* Taille de police réduite sur mobile */
    }
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    /* 6. Optimisation des onglets (Tabs) pour qu'ils ne dépassent pas */
    .source-tabs {
        flex-wrap: wrap; /* Permet aux onglets de passer à la ligne si besoin */
        gap: 5px;
    }
    .source-tab {
        flex: 1 1 40%; /* 2 onglets par ligne sur mobile */
        font-size: 0.8rem;
        text-align: center;
    }
}