@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --bg-dark: #0a0a0f;
    --bg-card: rgba(17, 17, 27, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --accent-blue: #4f46e5;
    --accent-purple: #7c3aed;
    --accent-pink: #ec4899;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-dark);
    background-image:
        radial-gradient(at 27% 37%, rgba(103, 126, 234, 0.15) 0px, transparent 50%),
        radial-gradient(at 97% 21%, rgba(124, 58, 237, 0.15) 0px, transparent 50%),
        radial-gradient(at 52% 99%, rgba(236, 72, 153, 0.15) 0px, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================
   MISE EN PAGE DYNAMIQUE
   ======================================== */

.app {
    display: flex;
    min-height: 100vh;
    position: relative;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* MODE INITIAL : Visage centré en grand */
.app.centered-mode {
    justify-content: center;
    align-items: center;
}

.app.centered-mode .left-panel {
    max-width: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.app.centered-mode .right-panel {
    position: absolute;
    right: -100%;
    opacity: 0;
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* MODE SPLIT : Visage à gauche, panneau à droite */
.app.split-mode {
    justify-content: flex-start;
}

.app.split-mode .left-panel {
    flex: 0 0 55%;
    max-width: 55%;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.app.split-mode .right-panel {
    flex: 0 0 45%;
    position: relative;
    right: 0;
    opacity: 1;
    pointer-events: auto;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Logo Header - VERSION COMPACTE */
.logo-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
    height: 80px;
}

.logo-header .logo-main {
    height: 48px;
    width: auto;
    filter: drop-shadow(0 4px 16px rgba(103, 126, 234, 0.5));
    flex-shrink: 0;
}

.header-controls {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;  /* ← CENTRÉ */
    gap: 20px;
    max-width: 500px;
    margin: 0 auto;  /* ← Centre le groupe */
}

.header-controls label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.header-slider-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

#lesion-size {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    outline: none;
    -webkit-appearance: none;
}

#lesion-size::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
    box-shadow: 0 0 20px rgba(103, 126, 234, 0.6);
    transition: all 0.3s ease;
}

#lesion-size::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 30px rgba(103, 126, 234, 0.9);
}

#lesion-size::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 20px rgba(103, 126, 234, 0.6);
    transition: all 0.3s ease;
}

#size-display {
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-width: 65px;
    text-align: right;
}

/* Colonne gauche */
.left-panel {
    padding: 100px 40px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* MODE CENTRÉ : Contrôles au-dessus du visage */
.app.centered-mode .left-panel {
    gap: 40px;
}

.app.centered-mode .controls-container {
    width: 100%;
    max-width: 600px;
}

.app.centered-mode .head-wrapper {
    width: 100%;
    max-width: 700px;
}

/* MODE SPLIT : Layout normal */
.app.split-mode .controls-container {
    width: 100%;
}

.app.split-mode .head-wrapper {
    width: 100%;
}

/* Les contrôles sont maintenant dans le header */
.controls-container {
    display: none;
}

.head-wrapper {
    margin-top: 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.6s ease;
}

/* MODE CENTRÉ : Visage plus grand */
.app.centered-mode .head-wrapper {
    padding: 60px;
    transform: scale(1.1);
}

/* MODE SPLIT : Visage encore plus grand à gauche */
.app.split-mode .head-wrapper {
    padding: 50px;
    transform: scale(1.05);
}

.head-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(103, 126, 234, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* Conteneur SVG avec image de fond */
.svg-container {
    position: relative;
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
    transition: all 0.6s ease;
}

/* MODE CENTRÉ : SVG encore plus grand */
.app.centered-mode .svg-container {
    max-width: 650px;
}

/* MODE SPLIT : SVG grand mais adapté */
.app.split-mode .svg-container {
    max-width: 600px;
}

#face-container {
    background-image: url('THE_BEST.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Colonne droite */
.right-panel {
    padding: 100px 40px 40px;
    background: rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.right-panel h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 32px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    animation: slideInRight 0.6s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

section {
    margin-bottom: 24px;
    border-radius: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    overflow: hidden;
    animation: slideInRight 0.6s ease;
    animation-fill-mode: both;
}

section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.2s; }
section:nth-child(4) { animation-delay: 0.3s; }

section:hover {
    border-color: rgba(103, 126, 234, 0.3);
}

/* Accordéon */
.accordion-header {
    margin: 0;
    padding: 20px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    position: relative;
}

.accordion-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--primary-gradient);
    border-radius: 0 2px 2px 0;
}

.accordion-header:hover {
    background: rgba(103, 126, 234, 0.1);
}

.accordion-icon {
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.accordion.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 24px;
}

.accordion.active .accordion-content {
    max-height: 1000px;
    padding: 0 24px 24px 24px;
}

ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

ul li {
    padding: 10px 16px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

ul li:hover {
    background: rgba(255, 255, 255, 0.08);
    border-left-color: var(--accent-purple);
    color: var(--text-primary);
    transform: translateX(4px);
}

.head-view {
    display: none;
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.head-view.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ZONES CLIQUABLES - Effets améliorés */
.click-zone {
    cursor: pointer;
    transition: all 0.3s ease;
    fill: transparent;
    /* Option: Contours couleur chair (désactivé par défaut) */
    /* stroke: #d4a574; */
    /* stroke-width: 0.5; */
    /* stroke-opacity: 0.3; */
}

.click-zone:hover {
    fill: rgba(103, 126, 234, 0.4) !important;
    stroke: rgba(103, 126, 234, 0.9) !important;
    stroke-width: 2 !important;
    stroke-opacity: 1 !important;
    filter: drop-shadow(0 0 8px rgba(103, 126, 234, 0.8));
}

.click-zone.selected {
    fill: rgba(236, 72, 153, 0.5) !important;
    stroke: rgba(236, 72, 153, 1) !important;
    stroke-width: 2.5 !important;
    stroke-opacity: 1 !important;
    filter: drop-shadow(0 0 12px rgba(236, 72, 153, 1));
    animation: pulse-zone 2s ease-in-out infinite;
}

@keyframes pulse-zone {
    0%, 100% {
        filter: drop-shadow(0 0 12px rgba(236, 72, 153, 0.8));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(236, 72, 153, 1));
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .app.split-mode {
        flex-direction: column;
    }

    .app.split-mode .left-panel,
    .app.split-mode .right-panel {
        flex: 1 1 auto;
        max-width: 100%;
        padding: 100px 24px 24px;
    }
    
    .app.centered-mode .left-panel {
        padding: 100px 24px 24px;
    }
}