/* ═══════════════════════════════════════════════════════
   VieNeu Voice Studio — Premium CSS
   Dark theme · Glassmorphism · Micro-animations
   ═══════════════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
:root {
    --bg-base: #0a0a0f;
    --bg-surface: #111118;
    --bg-elevated: #1a1a24;
    --bg-hover: #22222f;
    --bg-glass: rgba(255,255,255, 0.03);
    --border: rgba(255,255,255, 0.06);
    --border-focus: rgba(129,140,248, 0.4);
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --accent-glow: rgba(129,140,248, 0.15);
    --accent2: #c084fc;
    --green: #34d399;
    --red: #f87171;
    --orange: #fb923c;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.5);
    --shadow-glow: 0 0 40px rgba(129,140,248,.08);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 200ms cubic-bezier(.4,0,.2,1);
}

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

html {
    font-size: 15px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* ─── Background Grid Effect ─── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, rgba(129,140,248,.06) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 80% 20%, rgba(192,132,252,.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ═══ SAAS & AUTH STYLES ═══ */
.user-bar { display: flex; align-items: center; gap: 12px; }
.user-info-box { display: flex; align-items: center; gap: 12px; }
.user-details { text-align: right; }
.user-name { font-size: .85rem; font-weight: 700; color: var(--text-primary); }
.user-vip { font-size: .72rem; color: var(--green); font-weight: 600; }
.btn-primary-sm {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    font-weight: 600;
    font-size: .8rem;
    cursor: pointer;
}
.btn-secondary-sm {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-base);
    color: var(--text-secondary);
    font-size: .75rem;
    cursor: pointer;
}
.btn-key-sm {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--orange);
    background: rgba(251,146,60,.1);
    color: var(--orange);
    font-weight: 600;
    font-size: .78rem;
    cursor: pointer;
}
.btn-logout {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: .78rem;
    cursor: pointer;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    padding: 28px;
    position: relative;
    box-shadow: var(--shadow-lg);
}
.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
}
.modal-tabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.modal-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    padding-bottom: 4px;
}
.modal-tab.active { color: var(--accent); border-bottom: 2px solid var(--accent); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .8rem; color: var(--text-secondary); margin-bottom: 6px; }
.text-area-sm {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: .9rem;
}

/* Admin Dashboard */
.admin-tab { border: 1px solid var(--orange); color: var(--orange) !important; }
.admin-panel { display: flex; flex-direction: column; gap: 24px; }
.admin-box {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}
.admin-box h3 { font-size: .95rem; font-weight: 700; margin-bottom: 14px; color: var(--text-primary); }
.admin-form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-select, .admin-input {
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: .85rem;
}
.admin-input { flex: 1; min-width: 240px; }

.created-key-box {
    margin-top: 14px;
    padding: 12px 16px;
    background: rgba(52,211,153,.1);
    border: 1px solid var(--green);
    border-radius: var(--radius-sm);
    color: var(--green);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .9rem;
}

.table-responsive { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}
.admin-table th, .admin-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.admin-table th { color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: .7rem; }
.admin-table td { color: var(--text-secondary); }
.status-badge {
    padding: 2px 8px;
    border-radius: 100px;
    font-size: .7rem;
    font-weight: 600;
}
.status-active { background: rgba(52,211,153,.15); color: var(--green); }
.status-frozen { background: rgba(248,113,113,.15); color: var(--red); }
.status-expired { background: rgba(251,146,60,.15); color: var(--orange); }
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10,10,15,.85);
    backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--accent-glow);
    border: 1px solid rgba(129,140,248,.15);
    display: flex;
    align-items: center;
    justify-content: center;
}
.logo-text {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}
.logo-text span {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo-sub {
    font-size: .7rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.header-badge {
    display: flex;
    gap: 6px;
}
.badge {
    font-size: .7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    letter-spacing: .3px;
}
.badge-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

/* ═══ TABS ═══ */
.tabs {
    display: flex;
    gap: 4px;
    margin: 24px 0 20px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 4px;
    border: 1px solid var(--border);
    width: fit-content;
}
.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: .9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}
.tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.tab.active {
    color: var(--text-primary);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
}

.tab-content { display: none; position: relative; z-index: 1; }
.tab-content.active { display: block; animation: fadeIn .3s ease; }

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

/* ═══ STUDIO GRID ═══ */
.studio-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    align-items: start;
}

/* ═══ PANELS ═══ */
.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-glow);
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.panel-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ═══ TEXT AREA ═══ */
.text-area {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: .9rem;
    line-height: 1.7;
    resize: vertical;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.text-area:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.text-area::placeholder { color: var(--text-muted); }

.char-count {
    font-size: .75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* ═══ EMOTION TAGS ═══ */
.emotion-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 20px;
    flex-wrap: wrap;
}
.emotion-label {
    font-size: .8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.emotion-btn {
    padding: 5px 12px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--bg-glass);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: .78rem;
    cursor: pointer;
    transition: all var(--transition);
}
.emotion-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

/* ═══ VOICE SECTION ═══ */
.voice-section { margin: 20px 0; }
.voice-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.voice-section-header h3 {
    font-size: .9rem;
    font-weight: 600;
}
.filter-group { display: flex; gap: 4px; }
.filter-btn {
    padding: 4px 12px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: .72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}
.filter-btn:hover { color: var(--text-secondary); border-color: rgba(255,255,255,.12); }
.filter-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ═══ VOICE GRID ═══ */
.voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
}
.voice-grid::-webkit-scrollbar { width: 4px; }
.voice-grid::-webkit-scrollbar-track { background: transparent; }
.voice-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 100px; }

.voice-card {
    padding: 10px 12px;
    background: var(--bg-base);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}
.voice-card:hover {
    border-color: rgba(129,140,248,.2);
    background: var(--bg-hover);
    transform: translateY(-1px);
}
.voice-card.selected {
    border-color: var(--accent);
    background: var(--accent-glow);
    box-shadow: 0 0 16px rgba(129,140,248,.1);
}
.voice-card.selected::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: .65rem;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
}
.voice-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}
.voice-name {
    font-size: .82rem;
    font-weight: 600;
    margin-bottom: 3px;
    color: var(--text-primary);
}
.preview-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: .7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
    color: var(--text-muted);
}
.preview-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
    transform: scale(1.15);
}
.voice-meta {
    font-size: .68rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.voice-meta .region-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 100px;
    font-size: .6rem;
    font-weight: 600;
    margin-right: 4px;
}
.region-bac { background: rgba(59,130,246,.15); color: #60a5fa; }
.region-trung { background: rgba(251,146,60,.15); color: #fb923c; }
.region-nam { background: rgba(52,211,153,.15); color: #34d399; }
.gender-icon {
    display: inline-block;
    font-size: .65rem;
    margin-right: 2px;
}

/* ═══ ADVANCED CONTROLS ═══ */
.controls-advanced {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 16px 0;
}

/* ═══ CONTROLS ═══ */
.control-row { margin: 16px 0; }
.control-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.control-value {
    font-size: .78rem;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    font-weight: 600;
}
.control-hint {
    font-size: .7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 100px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    outline: none;
}
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(129,140,248,.3);
    transition: transform var(--transition);
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* ═══ BUTTONS ═══ */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    font-family: var(--font);
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(129,140,248,.2);
    margin-top: 8px;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 28px rgba(129,140,248,.3);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-base);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

/* ═══ OUTPUT AREA ═══ */
.output-placeholder, .loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    min-height: 200px;
}
.placeholder-icon { margin-bottom: 16px; opacity: .4; }
.output-placeholder p { font-size: .85rem; color: var(--text-muted); max-width: 280px; }
.output-placeholder strong { color: var(--text-secondary); }

.loading-state p { font-size: .9rem; color: var(--text-secondary); }
.loading-sub { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ RESULT CARD ═══ */
.result-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    animation: slideUp .3s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.result-voice-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.result-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.clone-avatar {
    background: linear-gradient(135deg, var(--green), #06b6d4);
    font-size: 1.1rem;
}
.result-voice-name { font-size: .9rem; font-weight: 600; }
.result-voice-meta { font-size: .75rem; color: var(--text-muted); }
.result-time {
    margin-left: auto;
    font-size: .75rem;
    color: var(--green);
    font-weight: 600;
    background: rgba(52,211,153,.1);
    padding: 3px 10px;
    border-radius: 100px;
}

.audio-player {
    width: 100%;
    height: 44px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(1.1);
}

.result-actions {
    display: flex;
    gap: 8px;
}

/* ═══ METRICS ROW ═══ */
.metrics-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.metric-tag {
    font-size: .7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-base);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

/* ═══ HISTORY ═══ */
.history-section {
    margin-top: 24px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}
.history-section h3 {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-empty { font-size: .78rem; color: var(--text-muted); text-align: center; padding: 16px; }

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}
.history-item:hover { border-color: rgba(129,140,248,.2); background: var(--bg-hover); }
.history-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .65rem;
    font-weight: 600;
    color: var(--accent);
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.history-item-text {
    flex: 1;
    min-width: 0;
    font-size: .78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.history-item-time {
    font-size: .68rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ═══ UPLOAD ZONE ═══ */
.upload-zone {
    margin: 16px 0;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-glow);
}
.upload-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    cursor: pointer;
    text-align: center;
    color: var(--text-muted);
}
.upload-inner svg { margin-bottom: 12px; opacity: .4; }
.upload-inner p { font-size: .85rem; }
.upload-inner strong { color: var(--accent); }
.upload-hint { font-size: .7rem; color: var(--text-muted); margin-top: 4px; }

.uploaded-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin: 12px 0;
    font-size: .82rem;
    color: var(--text-secondary);
}
.upload-remove {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}
.upload-remove:hover { background: rgba(248,113,113,.1); color: var(--red); }

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    color: var(--text-secondary);
    cursor: pointer;
    margin: 12px 0;
}
.checkbox-row input[type=checkbox] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}

.clone-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(129,140,248,.06);
    border: 1px solid rgba(129,140,248,.1);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}
.clone-info svg { flex-shrink: 0; margin-top: 2px; color: var(--accent); }
.clone-info p { font-size: .82rem; color: var(--text-secondary); line-height: 1.6; }
.clone-info strong { color: var(--accent); }

/* ═══ HOMEPAGE SECTIONS — SHARED ═══ */
.section-header {
    text-align: center;
    margin-bottom: 36px;
}
.section-badge {
    display: inline-block;
    padding: 5px 16px;
    border-radius: 100px;
    font-size: .72rem;
    font-weight: 700;
    background: rgba(129,140,248,.1);
    color: var(--accent);
    margin-bottom: 12px;
    letter-spacing: .5px;
}
.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.35;
    max-width: 600px;
    margin: 0 auto 8px;
}
.section-desc {
    font-size: .88rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ═══ FEATURES SECTION ═══ */
.features-section {
    padding: 56px 0;
    border-top: 1px solid var(--border);
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px 22px;
    transition: all var(--transition);
}
.feature-card:hover {
    border-color: rgba(129,140,248,.25);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.feature-icon {
    font-size: 2rem;
    margin-bottom: 14px;
}
.feature-card h3 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.feature-card p {
    font-size: .8rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ═══ EMOTION GUIDE SECTION ═══ */
.guide-section {
    padding: 56px 0;
    background: linear-gradient(180deg, rgba(129,140,248,.03) 0%, transparent 100%);
    border-top: 1px solid var(--border);
}
.guide-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}
.guide-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    transition: all var(--transition);
}
.guide-card:hover {
    border-color: rgba(129,140,248,.2);
    box-shadow: var(--shadow-sm);
}
.guide-tag {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(251,191,36,.12);
    color: #fbbf24;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: .85rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.guide-label {
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.guide-example {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 10px;
}
.guide-text {
    font-size: .8rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.6;
}
.guide-text mark {
    background: rgba(251,191,36,.2);
    color: #fbbf24;
    padding: 1px 5px;
    border-radius: 3px;
    font-style: normal;
    font-weight: 600;
}
.guide-desc {
    font-size: .75rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.guide-tips {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 28px;
}
.guide-tips h3 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.guide-tips ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.guide-tips li {
    font-size: .8rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 20px;
    position: relative;
}
.guide-tips li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}
.guide-tips li strong { color: var(--text-primary); }

/* ═══ STEPS SECTION ═══ */
.steps-section {
    padding: 56px 0;
    border-top: 1px solid var(--border);
}
.steps-grid {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
}
.step-card {
    flex: 1;
    max-width: 280px;
    text-align: center;
    padding: 28px 22px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}
.step-card:hover {
    border-color: rgba(129,140,248,.25);
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0,0,0,.2);
}
.step-number {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    margin: 0 auto 14px;
}
.step-card h3 {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.step-card p {
    font-size: .8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.step-card p strong { color: var(--accent); }
.step-line {
    width: 48px;
    height: 2px;
    background: linear-gradient(90deg, var(--border), var(--accent), var(--border));
    margin-top: 50px;
    flex-shrink: 0;
}

/* ═══ FAQ SECTION ═══ */
.faq-section {
    padding: 56px 0;
    background: linear-gradient(180deg, rgba(129,140,248,.03) 0%, transparent 100%);
    border-top: 1px solid var(--border);
}
.faq-list {
    max-width: 740px;
    margin: 0 auto;
}
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition);
}
.faq-item:hover {
    border-color: rgba(129,140,248,.2);
}
.faq-item.open {
    border-color: rgba(129,140,248,.3);
    box-shadow: var(--shadow-sm);
}
.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-surface);
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all var(--transition);
}
.faq-item.open .faq-question {
    color: var(--accent);
}
.faq-toggle {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-muted);
    transition: transform var(--transition);
    flex-shrink: 0;
    margin-left: 16px;
}
.faq-item.open .faq-toggle {
    transform: rotate(45deg);
    color: var(--accent);
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease, padding .35s ease;
    padding: 0 20px;
    background: var(--bg-base);
}
.faq-item.open .faq-answer {
    max-height: 300px;
    padding: 16px 20px;
}
.faq-answer p {
    font-size: .82rem;
    color: var(--text-secondary);
    line-height: 1.7;
}
.faq-answer strong { color: var(--text-primary); }

/* ═══ CTA SECTION ═══ */
.cta-section {
    padding: 48px 0;
    border-top: 1px solid var(--border);
}
.cta-inner {
    text-align: center;
    background: linear-gradient(135deg, rgba(129,140,248,.08), rgba(251,191,36,.06));
    border: 1px solid rgba(129,140,248,.15);
    border-radius: var(--radius-lg, 16px);
    padding: 44px 32px;
}
.cta-inner h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.cta-inner p {
    font-size: .88rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.btn-cta {
    display: inline-block;
    padding: 14px 36px;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(129,140,248,.3);
}
.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(129,140,248,.4);
}

/* ═══ FOOTER ═══ */
.footer {
    margin-top: auto;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
}
.footer-inner { text-align: center; }
.footer p { font-size: .75rem; color: var(--text-muted); }
.footer strong { color: var(--text-secondary); }
.footer-sub { margin-top: 4px; }

/* ═══ HERO BANNER ═══ */
.hero-section {
    background: linear-gradient(135deg, rgba(129,140,248,.08) 0%, rgba(251,191,36,.05) 100%);
    border-bottom: 1px solid var(--border);
    padding: 32px 0 28px;
}
.hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}
.hero-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 100px;
    font-size: .72rem;
    font-weight: 700;
    background: rgba(251,191,36,.15);
    color: #fbbf24;
    margin-bottom: 8px;
    letter-spacing: .5px;
}
.hero-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 8px;
}
.hero-title span {
    background: linear-gradient(135deg, #818cf8, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-desc {
    font-size: .88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 520px;
}
.hero-desc strong { color: var(--text-primary); }
.hero-stats {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
}
.hero-stat {
    text-align: center;
    padding: 14px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-width: 90px;
}
.hero-stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 2px;
}
.hero-stat-label {
    font-size: .65rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ═══ EMOTION TIP ═══ */
.emotion-tip {
    cursor: help;
    font-size: .75rem;
    opacity: .6;
    transition: opacity var(--transition);
}
.emotion-tip:hover { opacity: 1; }

/* ═══ ADMIN STATS DASHBOARD ═══ */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    text-align: center;
    transition: all var(--transition);
}
.stat-card:hover {
    border-color: rgba(129,140,248,.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.stat-icon { font-size: 1.5rem; margin-bottom: 6px; }
.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}
.stat-label { font-size: .72rem; color: var(--text-muted); font-weight: 500; margin-top: 2px; }
.stat-card-green .stat-value { color: #34d399; }
.stat-card-green:hover { border-color: rgba(52,211,153,.3); }
.stat-card-orange .stat-value { color: #fbbf24; }
.stat-card-orange:hover { border-color: rgba(251,191,36,.3); }
.stat-card-purple .stat-value { color: #a78bfa; }
.stat-card-purple:hover { border-color: rgba(167,139,250,.3); }

/* ═══ ADMIN SUBTABS ═══ */
.admin-subtabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}
.admin-subtab {
    padding: 10px 20px;
    font-family: var(--font);
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all var(--transition);
}
.admin-subtab:hover {
    color: var(--text-primary);
}
.admin-subtab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ═══ ADMIN SEARCH ═══ */
.admin-search {
    padding: 8px 14px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: .82rem;
    min-width: 240px;
    transition: border-color var(--transition);
}
.admin-search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.admin-search::placeholder { color: var(--text-muted); }

/* ═══ MY VOICES CARD ═══ */
.voice-card .clone-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 100px;
    font-size: .58rem;
    font-weight: 700;
    background: rgba(167,139,250,.15);
    color: #a78bfa;
    margin-right: 4px;
}
.voice-card .delete-voice-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: .7rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all var(--transition);
}
.voice-card .delete-voice-btn:hover {
    color: #f87171;
    background: rgba(248,113,113,.1);
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
    .studio-grid { grid-template-columns: 1fr; }
    .voice-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .header-badge { display: none; }
    .hero-inner { flex-direction: column; text-align: center; }
    .hero-stats { flex-wrap: wrap; justify-content: center; }
    .hero-desc { max-width: 100%; }
    .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .guide-grid { grid-template-columns: 1fr; }
    .guide-tips ul { grid-template-columns: 1fr; }
    .steps-grid { flex-direction: column; align-items: center; gap: 12px; }
    .step-line { width: 2px; height: 24px; margin: 0; }
}
@media (max-width: 600px) {
    html { font-size: 14px; }
    .container { padding: 0 16px; }
    .panel { padding: 16px; }
    .voice-grid { grid-template-columns: repeat(2, 1fr); max-height: 200px; }
    .hero-section { padding: 20px 0; }
    .hero-title { font-size: 1.2rem; }
    .hero-stats { gap: 10px; }
    .hero-stat { min-width: 70px; padding: 10px 12px; }
    .admin-stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .features-grid { grid-template-columns: 1fr; }
    .features-section, .guide-section, .steps-section, .faq-section { padding: 36px 0; }
    .section-title { font-size: 1.15rem; }
    .step-card { max-width: 100%; }
}
