/* === ALAPBEÁLLÍTÁSOK ÉS GLOBÁLIS STÍLUSOK === */
:root {
    --bg-main: #F8F9FC;
    --bg-secondary: #FFFFFF;
    --border-color: #EAEBF0;
    --text-primary: #1A202C;
    --text-secondary: #718096;
    --accent-primary: #4A55FF;
    --accent-secondary: #8A4DFF;
    --header-height: 64px;
    --mobile-nav-height: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background-color: var(--bg-main); color: var(--text-primary); font-size: 14px; overflow-y: hidden; }

/* === FŐ ELRENDEZÉS === */
.editor-container { display: flex; flex-direction: column; height: 100vh; }
.editor-main { display: grid; grid-template-columns: 80px 1fr 350px; height: calc(100vh - var(--header-height)); }
.left-nav, .center-stage { border-right: 1px solid var(--border-color); }

/* === FELSŐ SÁV === */
.top-bar { display: flex; justify-content: space-between; align-items: center; height: var(--header-height); padding: 0 24px; background-color: var(--bg-secondary); flex-shrink: 0; position: relative; z-index: 300; border-bottom: 1px solid var(--border-color); }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.logo-icon-wrapper { width: 32px; height: 32px; background-color: var(--accent-primary); color: white; border-radius: 8px; display: grid; place-items: center; }
.logo-icon-wrapper svg { width: 18px; height: 18px; }
.controls { display: flex; align-items: center; gap: 16px; }
.control-label { font-size: 13px; color: var(--text-secondary); margin-right: -8px; }
.gender-pills { display: flex; background-color: #F0F2F5; border-radius: 8px; padding: 4px; }
.gender-pills .pill { background: transparent; border: none; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-weight: 500; }
.gender-pills .pill.active { background-color: var(--bg-secondary); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.control-icon { background: none; border: none; color: var(--text-secondary); cursor: pointer; line-height: 1; padding: 0;}
.control-icon svg { width: 18px; height: 18px; }
.separator { width: 1px; height: 24px; background-color: var(--border-color); }

/* === BAL OLDALI IKONSÁV === */
.left-nav { display: flex; flex-direction: column; align-items: center; padding-top: 24px; gap: 8px; background-color: var(--bg-secondary); }
.nav-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; text-decoration: none; transition: all 0.2s ease; }
.nav-icon svg { width: 22px; height: 22px; color: var(--text-secondary); transition: color 0.2s ease; }
.nav-icon:hover { background-color: #F8F9FC; }
.nav-icon.active { background-color: var(--accent-primary); }
.nav-icon.active svg { color: white; }

/* === KÖZÉPSŐ RÉSZ === */
.center-stage { display: flex; flex-direction: column; padding: 24px; background-color: #FDFDFF; }
.live-preview-wrapper { flex-grow: 1; display: grid; place-items: center; position: relative; background-color: var(--bg-secondary); border-radius: 16px; border: 1px solid var(--border-color); }
.face-placeholder { position: relative; width: 400px; height: 520px; }
.preview-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; transition: transform 0.2s ease-out, opacity 0.2s ease-out; }
#neck-layer { z-index: 1; }
#base-layer { z-index: 2; }
#skull-layer { z-index: 3; }
#jaw-layer { z-index: 4; }
#chin-layer { z-index: 5; }
#chin-hole-layer { z-index: 6; }
#ears-layer { z-index: 7; }
#mouth-layer { z-index: 8; }
#lips-layer { z-index: 9; }
#cheek-layer { z-index: 10; }
#eye-background-layer { z-index: 11; }
#iris-layer { z-index: 12; }
#eye-shape-layer { z-index: 13; }
#folds-layer { z-index: 14; }
#nose-layer { z-index: 15; }
#eyebrows-layer { z-index: 16; }
.sun { position: absolute; top: 20%; right: 30%; width: 25px; height: 25px; background: #FFD700; border-radius: 50%; filter: blur(10px); opacity: 0.7; }

/* === JOBB OLDALI SZERKESZTŐ PANEL === */
.right-panel { background-color: var(--bg-secondary); padding: 24px; overflow-y: auto; }
.panel-title { font-size: 20px; font-weight: 700; }
.panel-subtitle { color: var(--text-secondary); margin-top: 4px; margin-bottom: 24px; }

/* === JOBB OLDALI KOMPONENSEK === */
.editor-card, .preview-card, .option-grid-container { background-color: var(--bg-main); border: 1px solid var(--border-color); border-radius: 12px; margin-bottom: 16px; }
.card-header { display: flex; justify-content: space-between; align-items: center; padding: 16px; cursor: pointer; font-weight: 600; }
.card-header svg { width: 14px; height: 14px; color: var(--text-secondary); transition: transform 0.2s ease; }
.card-body { display: none; padding: 16px; }
.editor-card.expanded .card-body { display: block; }
.editor-card.expanded .card-header svg { transform: rotate(90deg); }

.preview-card { padding: 24px; text-align: center; }
.preview-card-label { font-weight: 500; color: var(--text-secondary); }
.preview-card-icon { height: 100px; margin-top: 16px; display: grid; place-items: center; color: var(--text-primary); }
.preview-card-icon svg { max-height: 100%; max-width: 100%; }

.option-grid-container { padding: 16px; }
.option-grid-label { display: block; margin-bottom: 12px; font-weight: 500; color: var(--text-secondary); }
.option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.shape-option { background-color: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 8px; padding: 8px; text-align: center; cursor: pointer; transition: all 0.2s ease; }
.shape-option:hover { border-color: var(--accent-primary); }
.shape-option.active { border-color: var(--accent-primary); box-shadow: 0 0 0 1px var(--accent-primary); }
.shape-icon { display: flex; justify-content: center; align-items: center; margin: 0 auto 8px; height: 32px; color: var(--text-primary); }
.shape-icon svg { max-height: 100%; max-width: 100%; }
.shape-name { font-weight: 500; font-size: 12px; }

.slider-control { margin-top: 24px; padding: 0 8px; }
.slider-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.slider-value { font-weight: 500; color: var(--text-secondary); }
.slider-wrapper { position: relative; padding-bottom: 20px; }
.slider-markers { display: flex; justify-content: space-between; margin-top: 8px; padding: 0 4px; }
.slider-markers span { font-size: 12px; color: var(--text-secondary); }
.custom-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; background: #e2e8f0; border-radius: 4px; outline: none; cursor: pointer; --progress-percent: 75%; background: linear-gradient(to right, #d0d6e0 var(--progress-percent), #e2e8f0 var(--progress-percent)); }
.custom-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; background: var(--accent-primary); border-radius: 50%; border: 3px solid white; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); margin-top: -6px; }
.custom-slider::-moz-range-thumb { width: 14px; height: 14px; background: var(--accent-primary); border-radius: 50%; border: 3px solid white; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); cursor: pointer; }

.color-dropdown-wrapper { position: relative; }
.color-selector-btn { background: none; border: 1px solid var(--border-color); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; padding: 3px; }
.selected-color-swatch { display: block; width: 100%; height: 100%; border-radius: 50%; transition: background-color 0.2s ease; }
.color-dropdown-menu { display: none; position: absolute; top: calc(100% + 8px); right: 0; width: 200px; background-color: var(--bg-secondary); border-radius: 12px; border: 1px solid var(--border-color); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08); z-index: 100; padding: 8px; }
.color-dropdown-menu.show { display: block; }
.color-dropdown-menu ul { list-style: none; margin: 0; padding: 0; }
.color-dropdown-menu li { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 8px; cursor: pointer; transition: background-color 0.2s ease; }
.color-dropdown-menu li:hover { background-color: var(--bg-main); }
.color-swatch { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border-color); flex-shrink: 0; }
.card-body .color-dropdown-wrapper { width: 100%; }
.card-body .color-selector-btn { width: 100%; border-radius: 8px; padding: 8px; height: auto; background-color: var(--bg-secondary); }
.card-body .selected-color-swatch { width: 100%; height: 20px; border-radius: 4px; }
.card-body .color-dropdown-menu { width: 100%; right: auto; left: 0; }

@media (max-width: 768px) {
    body { overflow-y: auto; overflow-x: hidden; }
    .editor-main { display: flex; flex-direction: column; height: calc(100vh - var(--header-height)); padding-bottom: var(--mobile-nav-height); }
    .left-nav, .center-stage { border-right: none; }
    .left-nav { flex-direction: row; justify-content: space-around; position: fixed; bottom: 0; left: 0; width: 100%; height: var(--mobile-nav-height); padding: 0 8px; border-top: 1px solid var(--border-color); z-index: 200; background-color: var(--bg-secondary); }
    .center-stage { flex-shrink: 0; height: 40vh; min-height: 250px; padding: 16px; }
    .right-panel { flex-grow: 1; min-height: 0; border-left: none; overflow-y: auto; padding-bottom: 24px; }
    .top-bar .control-label { display: none; }
    .top-bar { padding: 0 16px; border-bottom: 1px solid var(--border-color); }
}