/* ==============================================
   STYLES STUDIO ARTICHAUT - VERSION WORDPRESS (Blindée & UX Mobile)
   ============================================== */

/* 1. DÉCLARATION DES POLICES */
@font-face {
    font-family: 'Fredoka';
    src: url('https://francisaitk.fr/simulateur-de-carte/font/Fredoka-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fredoka';
    src: url('https://francisaitk.fr/simulateur-de-carte/font/Fredoka-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fredoka';
    src: url('https://francisaitk.fr/simulateur-de-carte/font/Fredoka-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Patrick Hand';
    src: url('https://francisaitk.fr/simulateur-de-carte/font/PatrickHand-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* 2. LAYOUT GÉNÉRAL (Wrapper Isolé) */
.artichaut-app-wrapper {
    /* Variables dynamiques */
    --theme-color: #015e6e; 
    
    /* Reset Global Anti-Elementor */
    font-family: 'Fredoka', sans-serif !important;
    line-height: 1.5;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: transparent !important;
    color: #334155;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    isolation: isolate; 
}

/* Force le box-sizing */
.artichaut-app-wrapper *, 
.artichaut-app-wrapper *::before, 
.artichaut-app-wrapper *::after {
    box-sizing: border-box;
}

/* Force les couleurs de texte pour écraser le thème WP */
.artichaut-app-wrapper h1,
.artichaut-app-wrapper h2,
.artichaut-app-wrapper h3,
.artichaut-app-wrapper h4,
.artichaut-app-wrapper p,
.artichaut-app-wrapper span,
.artichaut-app-wrapper label,
.artichaut-app-wrapper div {
    color: #334155; 
    font-family: 'Fredoka', sans-serif !important;
}

.artichaut-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* --- ZONE APERÇU (GAUCHE/HAUT) --- */
.preview-area {
    flex: 1;
    min-width: 320px;
    position: relative;
    z-index: 5; 
}

/* Wrapper Sticky (Actif uniquement sur PC) */
.sticky-wrapper {
    position: sticky;
    top: 40px; 
    background: transparent !important; /* Pas de fond */
    padding: 0;
    border: none;
    z-index: 10;
}

.canvas-container {
    width: 100%;
    max-width: 450px;
    position: relative;
    overflow: hidden; 
    border-radius: 20px;
    /* Ombre portée élégante */
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2); 
    margin: 0 auto;
    transition: transform 0.3s ease;
    background: transparent !important; /* Pas de fond */
}

.canvas-container:hover {
    transform: translateY(-5px);
}

canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 20px;
}

/* --- EFFETS VISUELS (SURVOLE & LOOP) --- */

/* 1. AUTO-SHINE (La Loop infinie) */
.auto-shine {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 40%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 60%, rgba(255,255,255,0) 100%);
    transform: translateX(-150%) skewX(-20deg);
    animation: autoShine 8s infinite;
    pointer-events: none; z-index: 5;
}

@keyframes autoShine {
    0% { transform: translateX(-150%) skewX(-20deg); }
    20% { transform: translateX(250%) skewX(-20deg); }
    100% { transform: translateX(250%) skewX(-20deg); }
}

/* 2. HOLO-OVERLAY (Le Survol Interactif) */
.holo-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    /* Gradient plus fort pour le survol */
    background: linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 30%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0) 70%, rgba(255,255,255,0) 100%);
    transform: translateX(-150%) skewX(-20deg); /* Caché par défaut */
    pointer-events: none; z-index: 6; 
    mix-blend-mode: overlay;
}

/* Déclenchement au survol du conteneur */
.canvas-container:hover .holo-overlay {
    animation: hoverShine 0.8s ease-in-out;
}

@keyframes hoverShine {
    0% { transform: translateX(-150%) skewX(-20deg); }
    100% { transform: translateX(250%) skewX(-20deg); }
}

.render-status {
    margin-top: 15px; font-size: 13px; color: #f97316 !important; font-style: italic; text-align: center;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

/* --- ZONE ÉDITEUR (DROITE/BAS) --- */
.editor-area {
    flex: 1;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 25px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.editor-header {
    background: #ffffff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.section-title {
    margin: 0 !important;
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    color: var(--theme-color) !important;
    display: flex; align-items: center; gap: 10px;
    transition: color 0.3s ease;
}

/* --- NAVIGATION ONGLETS (Tabs) --- */
.tabs-nav {
    display: flex;
    background: #f8f9fa;
    padding: 0 10px;
    border-bottom: 1px solid #e2e8f0;
}

.artichaut-app-wrapper .tab-btn {
    /* Reset WP */
    appearance: none; -webkit-appearance: none;
    background: transparent;
    border: none; border-radius: 0; box-shadow: none; outline: none;
    
    flex: 1;
    padding: 18px 10px;
    cursor: pointer;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #64748b !important;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.artichaut-app-wrapper .tab-btn:hover {
    color: var(--theme-color) !important;
    background: color-mix(in srgb, var(--theme-color), transparent 95%);
}

.artichaut-app-wrapper .tab-btn.active {
    color: var(--theme-color) !important;
    border-bottom-color: var(--theme-color);
    background: #ffffff;
}

.artichaut-app-wrapper .tab-btn i { font-size: 1.2rem; margin-bottom: 2px; }

/* --- CONTENU ONGLETS --- */
.tabs-content-container { padding: 25px; min-height: 400px; background: #fff; }
.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-panel.active { display: block; }

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

/* --- FORMULAIRES & INPUTS --- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-group { margin-bottom: 20px; position: relative; }

.form-group label {
    display: block; margin-bottom: 8px; font-weight: 600; font-size: 1rem; color: #334155 !important;
}

.limit {
    font-size: 0.75rem; color: #94a3b8 !important; font-weight: normal; float: right; margin-top: 2px;
}

/* Reset des inputs WP + Elementor */
.artichaut-app-wrapper input[type="text"], 
.artichaut-app-wrapper select, 
.artichaut-app-wrapper textarea {
    width: 100%;
    margin: 0;
    padding: 10px 15px;
    min-height: 48px;
    line-height: 1.5;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    color: #334155;
    background: #f8fafc;
    transition: all 0.2s;
    box-shadow: none !important;
    outline: none !important;
}

.artichaut-app-wrapper textarea {
    min-height: auto; 
    padding: 12px 15px;
}

/* FORCE BRUTE pour écraser Elementor au Hover/Focus */
.artichaut-app-wrapper input[type="text"]:hover, 
.artichaut-app-wrapper select:hover, 
.artichaut-app-wrapper textarea:hover {
    border-color: var(--theme-color) !important;
    box-shadow: none !important; /* Pas d'ombre au survol */
}

.artichaut-app-wrapper input[type="text"]:focus, 
.artichaut-app-wrapper select:focus, 
.artichaut-app-wrapper textarea:focus {
    border-color: var(--theme-color) !important;
    background: #fff;
    /* On écrase l'outline par défaut d'Elementor */
    outline: none !important; 
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--theme-color), transparent 90%) !important;
}

.italic-input { font-style: italic; color: #64748b !important; }

/* --- SÉLECTEUR DE STYLE --- */
.variant-selector {
    background: #f1f5f9; padding: 15px; border-radius: 12px; margin-top: 20px;
}
.sub-label { 
    display: block; font-size:26px; font-weight: 600; margin-bottom: 10px; 
    color: var(--theme-color) !important; 
}
.radio-group { display: flex; gap: 10px; }
.radio-btn { flex: 1; cursor: pointer; position: relative; margin: 0; padding: 0; }
.radio-btn input { position: absolute; opacity: 0; width: 0; height: 0; }

.radio-visual {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    padding: 12px;
    background: #fff; 
    border: 2px solid #e2e8f0; 
    border-radius: 8px;
    font-weight: 600; color: #64748b !important;
    transition: all 0.2s;
}
.radio-visual i { font-size: 1.2rem; margin-bottom: 2px; }

.radio-btn input:checked + .radio-visual {
    border-color: var(--theme-color);
    background: color-mix(in srgb, var(--theme-color), white 90%);
    color: var(--theme-color) !important;
}

/* --- UPLOAD ZONE --- */
.drop-zone {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border: 2px dashed #cbd5e1; border-radius: 12px;
    padding: 30px; text-align: center; cursor: pointer;
    background: #f8fafc; transition: all 0.3s;
    margin-bottom: 20px;
}
.drop-zone:hover { 
    border-color: var(--theme-color);
    background: color-mix(in srgb, var(--theme-color), transparent 96%);
}
.drop-content i { font-size: 2.5rem; color: #94a3b8; margin-bottom: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* --- CROP CONTROLS --- */
.crop-controls {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 15px;
    opacity: 1; transition: opacity 0.3s;
}
.crop-controls.disabled { opacity: 0.5; pointer-events: none; }
.control-row { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.control-row:last-child { margin-bottom: 0; }
.control-row i { width: 20px; text-align: center; color: #64748b; }

.artichaut-app-wrapper input[type=range] {
    flex: 1; height: 6px; background: #e2e8f0; border-radius: 5px; appearance: none; padding: 0; margin: 0; border: none; min-height: auto;
}
.artichaut-app-wrapper input[type=range]::-webkit-slider-thumb {
    appearance: none; width: 18px; height: 18px; border-radius: 50%;
    background: var(--theme-color);
    cursor: pointer; border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* --- BOUTONS --- */
.artichaut-app-wrapper .artichaut-btn-random {
    appearance: none; border: none; outline: none;
    font-size: 13px;
    background: #f1f5f9;
    color: #334155 !important;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
}
.artichaut-app-wrapper .artichaut-btn-random:hover {
    background: #e2e8f0; color: #0f172a !important; transform: scale(1.05);
}
.artichaut-app-wrapper .artichaut-btn-random:active {
    transform: scale(0.95); background: #cbd5e1;
}
.artichaut-app-wrapper .artichaut-btn-random i { color: var(--theme-color); }

.artichaut-app-wrapper .btn-download {
    appearance: none; border: none; outline: none;
    width: 100%;
    background: linear-gradient(135deg, var(--theme-color) 0%, color-mix(in srgb, var(--theme-color), black 20%) 100%);
    color: white !important;
    padding: 16px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 10px color-mix(in srgb, var(--theme-color), transparent 60%);
    display: flex; justify-content: center; align-items: center; gap: 10px;
    margin-top: 5vh;
}
.artichaut-app-wrapper .btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px color-mix(in srgb, var(--theme-color), transparent 50%);
}
.artichaut-app-wrapper .btn-download:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px color-mix(in srgb, var(--theme-color), transparent 50%);
}

.separator { border: 0; border-top: 1px solid #eee; margin: 20px 0; }

/* Helpers Responsive */
.desktop-only { display: block; }
.mobile-only { display: none; }

/* ==============================================
   MOBILE RESPONSIVE (TRANSFORMATION)
   ============================================== */
@media (max-width: 900px) {
    .artichaut-layout {
        flex-direction: column;
        gap: 0;
    }

    .desktop-only { display: block; }
    .mobile-only { display: block; }

    /* 1. APERÇU (RELATIF, SANS FOND, SANS STICKY) */
    .preview-area {
        width: 100%;
        position: relative;
        z-index: 10;
        margin-bottom: 20px; /* Espace propre sous la carte */
        display: flex;
        justify-content: center;
    }

    .sticky-wrapper {
        position: relative !important; /* Force le flux normal */
        top: auto !important;
        border-radius: 0;
        padding: 0;
        background: transparent !important; /* Pas de fond */
        border: none !important;
        box-shadow: none !important;
    }

    /* Petit titre flottant sur mobile */
    .section-title.mobile-only {
        font-size: 0.9rem; margin-bottom: 10px; 
        color: #64748b !important;
        background: rgba(255,255,255,0.9);
        display: inline-flex; align-items: center; gap: 5px;
        padding: 6px 16px; border-radius: 20px;
        backdrop-filter: blur(5px);
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }

    .canvas-container {
    	width:auto;
        max-height: 50vh; 
        box-shadow: 0 10px 30px rgba(0,0,0,0.25);
        background: transparent !important; /* Pas de fond */
    }
    
    canvas {
        object-fit: contain; max-height: 50vh; width: auto; margin: 0 auto;
    }

    /* 2. ÉDITEUR & ONGLETS */
    .editor-area {
        width: 100%;
        border-radius: 25px 25px 0 0;
        border: none;
        box-shadow: 0 -5px 25px rgba(0,0,0,0.1);
        background: #fff;
        position: relative;
        /* Pas de z-index négatif ou de superposition forcée */
    }

    .editor-header { display: flex; heigth:70px; }

    /* NAV MOBILE REVISITÉE (Tous visibles + Icone dessus) */
    .tabs-nav {
        overflow-x: auto; /* Sécurité si écran minuscule */
        padding: 0; /* Plus collé aux bords pour maximiser l'espace */
        background: #fff;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid #e2e8f0;
        scrollbar-width: none;
        border-radius: 25px 25px 0 0;
        display: flex;
        justify-content: space-between; /* Répartir l'espace */
    }
    .tabs-nav::-webkit-scrollbar { display: none; }

    .artichaut-app-wrapper .tab-btn {
        flex: 1; /* Force la largeur égale */
        margin-right: 0; /* Pas de marge entre eux */
        background: transparent; /* Fond transparent pour look "App Bar" */
        color: #94a3b8 !important; /* Gris plus clair inactif */
        border-radius: 0; /* Pas de boutons ronds, style "Tab" */
        padding: 12px 5px; /* Padding réduit sur les côtés */
        flex-direction: column; /* ICONE AU DESSUS */
        border: none;
        font-size: 0.75rem; /* Texte plus petit */
        gap: 4px;
        border-bottom: 3px solid transparent; /* Prépare l'état actif */
    }

    .artichaut-app-wrapper .tab-btn i { 
        font-size: 1.2rem; 
        margin: 0; 
        margin-bottom: 2px;
    }
    
    .artichaut-app-wrapper .tab-btn span {
        display: block; /* S'assure que le texte est bien en dessous */
    }

    /* État actif minimaliste pour mobile */
    .artichaut-app-wrapper .tab-btn.active {
        background: transparent;
        color: var(--theme-color) !important;
        box-shadow: none; /* Pas d'ombre portée */
        border-bottom-color: var(--theme-color); /* Soulignement couleur */
    }

    /* Contenu des onglets */
    .tabs-content-container {
        background: #fff;
        padding: 20px 15px 20px 15px;
        max-height: 60vh;
    }

    .form-grid { grid-template-columns: 1fr; }
    
    /* Bouton random flottant sur mobile */
    .artichaut-app-wrapper{
        background: #fff;
        padding: 0px;
        border-radius: 50px;
        color: var(--theme-color) !important;
    }
        .artichaut-btn-random {
        position: relative;
        z-index: 900;
        background: #fff;
        box-shadow: 0 4px 20px rgba(0,0,0,0.2);
        padding: 12px 20px;
        border-radius: 50px;
        color: var(--theme-color) !important;
        border: 2px solid var(--theme-color);
    }

    .artichaut-app-wrapper .artichaut-btn-random:active {
        transform: scale(0.95);
        background: #f1f5f9;
    }
}