:root {
    --bg-dark: #070709;
    --card-bg: rgba(20, 20, 25, 0.85);
    --gold-main: #d4af37;
    --gold-glow: #f3e5ab;
    --gold-dim: #aa8c2c;
    --border-gold: rgba(212, 175, 55, 0.2);
    --border-gold-focus: rgba(212, 175, 55, 0.6);
    --text-main: #f4f4f6;
    --text-dim: #a1a1ab;
    --emerald-glow: #10b981;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: radial-gradient(circle at top right, rgba(212, 175, 55, 0.05), transparent 60%);
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 0;
}

/* Header Section */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-gold);
    padding-bottom: 24px;
    margin-bottom: 40px;
}

.brand {
    display: flex;
    flex-direction: column;
}

.brand h1 {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -2px;
    margin: 0;
    background: linear-gradient(to right, #ffffff, var(--gold-glow), var(--gold-main));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand .tagline {
    color: var(--gold-main);
    font-size: 0.9rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 5px;
}

.nav-back {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-gold);
    padding: 10px 20px;
    border-radius: 12px;
    color: var(--gold-main);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.nav-back:hover {
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
    transform: translateX(-5px);
}

/* Layout Grid */
.layout-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 1024px) {
    .layout-grid {
        grid-template-columns: 1fr;
    }
}

/* Panel Design */
.panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-gold);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--gold-main), transparent);
}

.panel-title {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-main);
    margin-top: 0;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.panel-title .gold-dot {
    width: 8px;
    height: 8px;
    background-color: var(--gold-main);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--gold-main);
}

/* Slider Controls */
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.slider-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.slider-label {
    color: var(--text-dim);
}

.slider-val {
    color: var(--gold-main);
    font-weight: 700;
}

.slider-input {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    outline: none;
    transition: background 0.3s;
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gold-main);
    cursor: pointer;
    box-shadow: 0 0 10px var(--gold-main);
    transition: transform 0.2s, background-color 0.2s;
}

.slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--gold-glow);
}

/* Form Controls */
.input-field {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    box-sizing: border-box;
    transition: all 0.3s;
}

.input-field:focus {
    border-color: var(--border-gold-focus);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

/* Custom Select Box Styling */
.select-box {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.3s;
}

.select-box:focus {
    border-color: var(--border-gold-focus);
}

.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper::after {
    content: '▼';
    font-size: 0.8rem;
    color: var(--gold-main);
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Buttons */
.btn-gold {
    background: linear-gradient(135deg, var(--gold-main), var(--gold-dim));
    border: 1px solid var(--gold-main);
    color: #000;
    font-weight: 700;
    padding: 14px 28px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.25);
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-glow), var(--gold-main));
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}

.btn-gold:active {
    transform: translateY(0);
}

.btn-gold:disabled {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Custom Audio Visualizer */
.visualizer-container {
    background: rgba(0, 0, 0, 0.5);
    border: 1px dashed var(--border-gold);
    border-radius: 16px;
    height: 120px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#wave-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.visualizer-overlay {
    z-index: 2;
    text-align: center;
    pointer-events: none;
}

.visualizer-text {
    color: var(--gold-main);
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

/* File Upload Area */
.upload-area {
    border: 1px dashed var(--border-gold);
    background: rgba(255, 255, 255, 0.01);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 25px;
}

.upload-area:hover {
    background: rgba(212, 175, 55, 0.03);
    border-color: var(--border-gold-focus);
}

.upload-area p {
    margin: 5px 0;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.upload-area .gold-text {
    color: var(--gold-main);
    font-weight: 700;
}

/* Telemetry Terminal Console */
.terminal {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    height: 220px;
    padding: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    color: var(--gold-glow);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 25px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

/* Custom scrollbar for console */
.terminal::-webkit-scrollbar {
    width: 6px;
}
.terminal::-webkit-scrollbar-track {
    background: transparent;
}
.terminal::-webkit-scrollbar-thumb {
    background: var(--border-gold);
    border-radius: 10px;
}

.terminal-line {
    opacity: 0.85;
    line-height: 1.4;
}

.terminal-line.success {
    color: var(--emerald-glow);
}

.terminal-line.system {
    color: var(--gold-main);
    font-weight: 700;
}

/* Personas Grid */
.personas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.persona-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.persona-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gold-main);
    transition: width 0.3s;
}

.persona-card:hover {
    background: rgba(212, 175, 55, 0.03);
    border-color: var(--border-gold);
    transform: translateY(-4px);
}

.persona-card.active {
    background: rgba(212, 175, 55, 0.05);
    border-color: var(--border-gold-focus);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.1);
}

.persona-card.active::after {
    width: 100%;
}

.persona-card h3 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    color: var(--text-main);
}

.persona-card .meta {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.persona-card .metrics-badge {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: var(--gold-main);
    background: rgba(212, 175, 55, 0.05);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.15);
}

/* Synthesis Panel Group */
.synthesis-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lyric-input-wrapper {
    position: relative;
    display: flex;
    width: 100%;
}

.lyric-input-wrapper .input-field {
    padding-right: 120px;
}

.lyric-input-wrapper .synth-btn-inline {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--gold-main), var(--gold-dim));
    border: none;
    color: #000;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    text-transform: uppercase;
    transition: all 0.3s;
}

.lyric-input-wrapper .synth-btn-inline:hover {
    background: var(--gold-glow);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

/* Glowing Pulse Nodes */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--gold-main);
    font-weight: 700;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--gold-main);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--gold-main);
    animation: gold-pulse 2s infinite;
}

@keyframes gold-pulse {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(212, 175, 55, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

/* Audio Wave Visualizer Simulation Keyframes */
@keyframes wave-play {
    0% { height: 10px; }
    50% { height: 60px; }
    100% { height: 10px; }
}
