/* =========================================
   CORE STYLES & VARIABLES
========================================= */
:root {
    --color-bg: #030305;
    --color-glass: rgba(15, 15, 20, 0.45);
    --color-glass-border: rgba(255, 255, 255, 0.08);
    --color-text-main: #ffffff;
    --color-text-muted: rgba(255, 255, 255, 0.5);
    --color-accent: #5227FF;
    --color-accent-glow: rgba(82, 39, 255, 0.5);
    --transition-smooth: 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--color-bg); color: var(--color-text-main);
    font-family: 'Inter', -apple-system, sans-serif;
    overflow: hidden; height: 100vh;
    display: flex; justify-content: center; align-items: center;
}

#webgl-background { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }

.app-container {
    position: relative; z-index: 10;
    display: flex; gap: 2rem; width: 95%; max-width: 1400px; height: 85vh;
}

.glass-panel {
    background: var(--color-glass); backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid var(--color-glass-border); border-radius: 32px; padding: 3rem;
    box-shadow: 0 30px 60px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
    display: flex; flex-direction: column;
}

.input-section { flex: 0 0 380px; }
.result-section { flex: 1; opacity: 0; transform: translateX(40px) scale(0.95); transition: all var(--transition-smooth); pointer-events: none; }
.result-section.visible { opacity: 1; transform: translateX(0) scale(1); pointer-events: all; }

header { display: flex; flex-direction: column; margin-bottom: 2.5rem; position: relative; }
.status-dot { width: 8px; height: 8px; background: #00ff88; border-radius: 50%; position: absolute; top: 5px; right: 0; box-shadow: 0 0 10px #00ff88; animation: pulse 2s infinite; }
h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: 2px; }
.subtitle { color: var(--color-text-muted); font-size: 0.85rem; text-transform: uppercase; margin-top: 0.5rem; }

.form-grid { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.input-wrapper { display: flex; flex-direction: column; gap: 0.5rem; flex: 1; min-width: 120px; }
.input-wrapper.full-width { flex: 0 0 100%; }
label { font-size: 0.75rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 1px; }

input {
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05); border-radius: 12px;
    padding: 1rem; color: white; font-size: 1.1rem; transition: all 0.3s ease;
}
input:focus { outline: none; border-color: var(--color-accent); background: rgba(0,0,0,0.5); box-shadow: 0 0 20px var(--color-accent-glow); }

.submit-btn {
    width: 100%; margin-top: 1rem; padding: 1.2rem; background: var(--color-accent);
    border: none; border-radius: 16px; color: white; font-weight: 700; letter-spacing: 2px;
    cursor: pointer; position: relative; overflow: hidden; transition: transform 0.2s;
}
.submit-btn:hover { transform: translateY(-3px); }
.submit-btn .btn-glow {
    position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); transform: skewX(-20deg);
}
.submit-btn:hover .btn-glow { animation: scanBtn 1s infinite; }

.result-layout { display: flex; height: 100%; gap: 2rem; }
.data-column { flex: 1.2; display: flex; flex-direction: column; justify-content: flex-start; gap: 2rem; overflow-y: auto; padding-right: 10px;}
.data-column::-webkit-scrollbar { width: 4px; }
.data-column::-webkit-scrollbar-thumb { background: var(--color-accent); border-radius: 10px; }

.gradient-text { font-size: 2.5rem; background: linear-gradient(45deg, #fff, #888); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.data-card {
    background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); border-radius: 16px;
    padding: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.data-label { font-size: 0.7rem; color: var(--color-text-muted); letter-spacing: 1px; }
.data-value { font-size: 1.8rem; font-weight: 300; }
.data-value.highlight { font-weight: 600; text-shadow: 0 0 15px currentColor; }

/* --- AI ADVICE PANEL --- */
.advice-panel {
    background: rgba(0, 0, 0, 0.3); border: 1px solid var(--color-accent-glow);
    border-radius: 16px; padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column;
}
.advice-header { color: var(--color-accent); font-size: 0.8rem; letter-spacing: 2px; font-weight: 700; margin-bottom: 1rem; display: flex; align-items: center; gap: 8px; }
.advice-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.advice-list li {
    font-size: 0.9rem; line-height: 1.5; color: rgba(255,255,255,0.8);
    position: relative; padding-left: 20px; border-left: 2px solid var(--color-accent);
    animation: fadeInText 0.5s ease forwards; opacity: 0;
}
.advice-list li:nth-child(1) { animation-delay: 0.2s; }
.advice-list li:nth-child(2) { animation-delay: 0.5s; }
.advice-list li:nth-child(3) { animation-delay: 0.8s; }

/* Зона голограммы */
.avatar-column {
    flex: 0.8; position: relative; display: flex; flex-direction: column;
    align-items: center; justify-content: flex-end;
    background: radial-gradient(circle at center, rgba(255,255,255,0.02) 0%, transparent 70%);
    border-radius: 24px; overflow: hidden; border: 1px solid rgba(255,255,255,0.03);
}
#avatar-canvas { width: 100%; height: 100%; z-index: 2; position: absolute; bottom: 0; }

.avatar-pedestal {
    width: 80%; height: 15px; background: radial-gradient(ellipse at center, rgba(82, 39, 255, 0.5) 0%, transparent 70%);
    position: absolute; bottom: 5%; filter: blur(4px); z-index: 1; transition: background 0.5s;
}
.scanner-line {
    position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    background: var(--color-accent); box-shadow: 0 0 20px var(--color-accent), 0 0 40px var(--color-accent);
    z-index: 3; opacity: 0;
}
.result-section.visible .scanner-line { animation: scanHologram 2.5s ease-in-out forwards; }

@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.3; } 100% { opacity: 1; } }
@keyframes scanBtn { 0% { left: -100%; } 100% { left: 200%; } }
@keyframes scanHologram { 0% { top: 0%; opacity: 0; } 10% { opacity: 1; } 90% { top: 95%; opacity: 1; } 100% { top: 100%; opacity: 0; } }
@keyframes fadeInText { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }
/* --- GENDER TOGGLE STYLES --- */
.gender-toggle .toggle-container {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.gender-toggle input[type="radio"] {
    display: none; /* Прячем стандартные кружочки */
}

.gender-toggle .toggle-btn {
    flex: 1;
    padding: 12px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.gender-toggle input[type="radio"]:checked + .toggle-btn {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
    box-shadow: 0 0 20px var(--color-accent-glow);
    transform: translateY(-2px);
}
/* --- LANGUAGE SWITCH & FOOTER CREDIT --- */
.lang-switch {
    position: absolute;
    top: 30px;
    right: 40px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--color-glass-border);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 1px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.lang-switch:hover {
    border-color: var(--color-accent);
    box-shadow: 0 0 15px var(--color-accent-glow);
    transform: translateY(-2px);
}

.credit-footer {
    position: absolute;
    bottom: 20px;
    right: 40px;
    z-index: 100;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    letter-spacing: 1px;
}

.credit-footer .glow-text {
    color: var(--color-accent);
    font-weight: 800;
    text-shadow: 0 0 12px var(--color-accent-glow);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}
.lang-switch-container {
    position: absolute;
    top: 40px;    /* Отступ сверху */
    right: 50px;  /* Отступ справа (жесткая фиксация) */
    z-index: 1000; /* Поверх всего */
    
    width: 100px;
    height: 40px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.3);
}

.lang-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 44px;
    height: 30px;
    /* Цвет берется из JS и совпадает с цветом ИМТ */
    background: var(--color-accent, rgba(255, 255, 255, 0.2)); 
    border-radius: 20px;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), background 0.4s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.lang-switch-container.en-active .lang-slider {
    transform: translateX(48px); /* Плавный сдвиг вправо на EN */
}

.lang-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    z-index: 2;
    width: 46px;
    text-align: center;
    transition: color 0.4s ease, text-shadow 0.4s ease;
    user-select: none;
}

.lang-text.active {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}