/* ==========================================================================
   CSS Tokens & Variable Systems
   ========================================================================== */
:root {
    --bg-dark: #07080e;
    --bg-card: rgba(16, 18, 35, 0.55);
    --bg-card-hover: rgba(22, 26, 51, 0.7);
    --border-color: rgba(255, 255, 255, 0.07);
    --border-glow: rgba(168, 85, 247, 0.25);
    
    --color-primary: #a855f7;
    --color-secondary: #3b82f6;
    --color-accent: #06b6d4;
    --color-text-main: #f3f4f6;
    --color-text-muted: #9ca3af;
    --color-success: #10b981;
    --color-danger: #ef4444;
    
    --grad-primary: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    --grad-glow: linear-gradient(135deg, rgba(168, 85, 247, 0.4), rgba(59, 130, 246, 0.4));
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;
    
    --shadow-neon: 0 0 20px rgba(168, 85, 247, 0.15), 0 0 40px rgba(59, 130, 246, 0.1);
    --shadow-neon-strong: 0 0 30px rgba(168, 85, 247, 0.35), 0 0 60px rgba(59, 130, 246, 0.25);
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--color-text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* ==========================================================================
   Visual Background Accents & Grid
   ========================================================================== */
.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -2;
    opacity: 0.35;
    pointer-events: none;
}

.bg-glow-1 {
    top: -100px;
    left: -100px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.4) 0%, rgba(0,0,0,0) 70%);
}

.bg-glow-2 {
    bottom: -150px;
    right: -100px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, rgba(0,0,0,0) 70%);
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    pointer-events: none;
}

/* ==========================================================================
   Typography & Headers
   ========================================================================== */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
}

h1 { font-size: 3.5rem; line-height: 1.15; }
h2 { font-size: 2.25rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
h4 { font-size: 1.2rem; }

p {
    color: var(--color-text-muted);
}

.text-center { text-align: center; }
.gradient-text {
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 5rem 0;
}

.section-header {
    margin-bottom: 3.5rem;
}

.section-header p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0.5rem auto 0;
}

/* ==========================================================================
   Header Navigation
   ========================================================================== */
.app-header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 100;
    background: rgba(7, 8, 14, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    transition: var(--transition-smooth);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: #ffffff;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--grad-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.logo-text span {
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    position: relative;
    padding: 0.25rem 0;
}

.nav-link:hover, .nav-link.active {
    color: #ffffff;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--grad-primary);
    border-radius: 2px;
}

/* ==========================================================================
   Buttons UI Components
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-smooth);
    border: none;
}

.btn-primary {
    background: var(--grad-primary);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-lg {
    padding: 0.9rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

.btn-block {
    width: 100%;
}

.btn-icon-only {
    padding: 0.6rem;
    aspect-ratio: 1;
    border-radius: 10px;
}

.btn-glow-active:hover {
    animation: neon-glow-pulse 1.5s infinite alternate;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
    padding: 6rem 0 4rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-primary);
    margin-bottom: 2rem;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--color-primary);
    animation: pulse 1.5s infinite;
}

.hero-subtitle {
    font-size: 1.25rem;
    max-width: 700px;
    margin: 1.5rem auto 2.5rem;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ==========================================================================
   Glassmorphism Card & Tabs System
   ========================================================================== */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.25rem;
    box-shadow: var(--shadow-neon);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    box-shadow: var(--shadow-neon-strong);
    border-color: rgba(255, 255, 255, 0.12);
}

.playground-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 2rem;
    align-items: stretch;
}

/* Tabs */
.tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    gap: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid transparent;
    transition: var(--transition-smooth);
}

.tab-btn i {
    width: 16px;
    height: 16px;
}

.tab-btn:hover {
    color: #ffffff;
}

.tab-btn.active {
    color: #ffffff;
    border-color: var(--color-primary);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

/* ==========================================================================
   Form Controls & Custom Sliders
   ========================================================================== */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.input-group label {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    color: #ffffff;
    text-transform: uppercase;
}

textarea, select, input[type="text"] {
    width: 100%;
    background: rgba(7, 8, 14, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 0.85rem 1rem;
    outline: none;
    transition: var(--transition-smooth);
}

textarea:focus, select:focus, input[type="text"]:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.control-row {
    display: flex;
    gap: 1rem;
}

.flex-1 { flex: 1; }

.custom-select-wrapper {
    position: relative;
}

.custom-select-wrapper::after {
    content: '\25BC';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.5rem;
}

/* Sliders */
.playground-settings-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1.75rem;
    margin-top: 2rem;
}

.settings-sliders {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.75rem;
}

.slider-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 500;
}

.slider-val {
    color: var(--color-accent);
    font-family: var(--font-mono);
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--grad-primary);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
    transition: var(--transition-smooth);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Voice Cloning Specifics */
.voice-clone-source-options {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.upload-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: rgba(255, 255, 255, 0.01);
}

.upload-dropzone:hover {
    border-color: var(--color-primary);
    background: rgba(168, 85, 247, 0.02);
}

.dropzone-icon {
    width: 42px;
    height: 42px;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.dropzone-text {
    font-family: var(--font-heading);
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.dropzone-text span {
    color: var(--color-primary);
    font-weight: 600;
}

.dropzone-subtext {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.hidden-input {
    display: none;
}

.file-info-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: var(--color-success);
    font-size: 0.9rem;
    margin-top: 1rem;
}

.file-info-badge button {
    background: transparent;
    border: none;
    color: var(--color-success);
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* Mic Recorder UI */
.mic-recorder-panel {
    border: 1px solid var(--border-color);
    background: rgba(7, 8, 14, 0.4);
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.recorder-visuals {
    position: relative;
    margin-bottom: 1.5rem;
}

.btn-record {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    z-index: 2;
    position: relative;
}

.btn-record:hover {
    border-color: var(--color-danger);
    background: rgba(239, 68, 68, 0.05);
    color: var(--color-danger);
}

.btn-record.recording {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.record-btn-wrapper {
    position: relative;
    display: inline-block;
}

.record-pulse {
    position: absolute;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    top: 0;
    left: 0;
    border: 2px solid var(--color-danger);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

.btn-record.recording + .record-pulse {
    animation: record-pulsate 1.5s infinite;
}

.record-timer {
    display: block;
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--color-text-muted);
}

.recorder-hint {
    font-size: 0.85rem;
}

/* ==========================================================================
   Output Panel & Player UI
   ========================================================================== */
.output-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-text-muted);
}

.status-dot.active {
    background-color: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}

.status-dot.loading {
    background-color: var(--color-primary);
    box-shadow: 0 0 8px var(--color-primary);
    animation: pulse 1s infinite alternate;
}

.quality-tag {
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-accent);
}

.player-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

/* Waveform Visualizer */
.waveform-container {
    height: 140px;
    background: rgba(7, 8, 14, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

#waveform-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.waveform-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 13, 25, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.waveform-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(168, 85, 247, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: rotate 0.8s linear infinite;
}

.waveform-overlay p {
    font-size: 0.85rem;
    color: #ffffff;
    font-weight: 500;
}

.voice-meta h3 {
    margin-bottom: 0.25rem;
}

.voice-meta p {
    font-size: 0.85rem;
}

/* Custom Player Controls */
.player-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
}

.time-display {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    display: flex;
    gap: 0.25rem;
    color: var(--color-text-muted);
}

.btn-play-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--grad-primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
    transition: var(--transition-smooth);
}

.btn-play-toggle:hover:not(.disabled) {
    transform: scale(1.08);
    box-shadow: 0 0 18px rgba(168, 85, 247, 0.5);
}

.btn-play-toggle.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100px;
}

.volume-control i {
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
}

.volume-control input[type="range"] {
    flex: 1;
}

/* Actions Row */
.output-actions {
    display: flex;
    gap: 0.75rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.disabled-action {
    opacity: 0.5;
    pointer-events: none;
}

/* ==========================================================================
   Voice Library / Gallery
   ========================================================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.voice-card {
    padding: 1.75rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 250px;
}

.voice-card.active {
    border-color: var(--color-primary);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
}

.voice-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.gender-pill {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.gender-pill.male {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-secondary);
}

.gender-pill.female {
    background: rgba(168, 85, 247, 0.15);
    color: var(--color-primary);
}

.btn-card-play {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-card-play:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    transform: scale(1.1);
}

.voice-card h4 {
    margin-bottom: 0.25rem;
}

.voice-tagline {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
}

.voice-card-desc {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.voice-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 0.75rem;
}

.voice-card-footer .arrow {
    width: 14px;
    height: 14px;
    opacity: 0.5;
    transition: var(--transition-smooth);
}

.voice-card:hover .voice-card-footer .arrow {
    transform: translateX(4px);
    opacity: 1;
    color: var(--color-primary);
}

/* ==========================================================================
   Developer API Console
   ========================================================================== */
.api-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
}

.developer-stats {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stat-row {
    display: flex;
    gap: 1rem;
}

.stat-card {
    flex: 1;
    background: rgba(7, 8, 14, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: #ffffff;
    margin: 0.25rem 0;
}

.stat-trend {
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-trend.positive { color: var(--color-success); }
.stat-trend.neutrality { color: var(--color-accent); }

.stat-trend i { width: 10px; height: 10px; }

/* SVG Graph */
.chart-wrapper {
    background: rgba(7, 8, 14, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
}

.chart-title {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
    display: block;
}

.request-chart {
    width: 100%;
    height: auto;
}

/* Key Management */
.api-key-manager {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: auto;
}

.api-key-manager label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    display: block;
}

.api-key-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.api-key-input-wrapper input {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    background: rgba(7, 8, 14, 0.8);
    flex: 1;
}

.mt-3 { margin-top: 0.75rem; }

/* Code Panel */
.docs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}

.code-tabs {
    display: flex;
    background: rgba(7, 8, 14, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.25rem;
}

.code-tab {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition-smooth);
}

.code-tab.active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.code-block-wrapper {
    background: rgba(7, 8, 14, 0.85);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.code-block {
    display: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.5;
    color: #cbd5e1;
}

.code-block.active {
    display: block;
}

.code-keyword { color: #f472b6; }
.code-string { color: #34d399; }
.code-number { color: #fb7185; }

/* ==========================================================================
   Pricing Section
   ========================================================================== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.pricing-card {
    display: flex;
    flex-direction: column;
    padding: 2.5rem;
}

.pricing-card.recommended {
    border-color: var(--color-primary);
    background: linear-gradient(180deg, rgba(168,85,247,0.08) 0%, rgba(16,18,35,0.55) 100%);
    transform: scale(1.03);
    z-index: 2;
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--grad-primary);
}

.popular-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--grad-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pricing-card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.pricing-card-header h3 {
    margin-bottom: 0.75rem;
}

.price {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
    margin-bottom: 1rem;
}

.price .symbol { font-size: 1.5rem; font-weight: 500; }
.price .amount { font-size: 3rem; font-weight: 800; font-family: var(--font-heading); }
.price .period { font-size: 0.9rem; color: var(--color-text-muted); }

.pricing-desc {
    font-size: 0.85rem;
    line-height: 1.4;
}

.pricing-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 2.5rem;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.pricing-features li i {
    width: 16px;
    height: 16px;
    color: var(--color-success);
}

.mt-auto { margin-top: auto; }

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
    border-top: 1px solid var(--border-color);
    background: rgba(7, 8, 14, 0.95);
    padding: 4rem 0 2rem;
    margin-top: 5rem;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    gap: 4rem;
}

.footer-brand {
    max-width: 320px;
}

.footer-brand p {
    font-size: 0.9rem;
    margin-top: 1rem;
}

.footer-links-grid {
    display: flex;
    gap: 5rem;
}

.footer-link-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-link-col h4 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.footer-link-col a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition-smooth);
}

.footer-link-col a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 2rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Keyframes & Animations
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.4); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(168, 85, 247, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); }
}

@keyframes record-pulsate {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.6); opacity: 0; }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes neon-glow-pulse {
    0% { box-shadow: 0 4px 15px rgba(168, 85, 247, 0.2); }
    100% { box-shadow: 0 4px 25px rgba(168, 85, 247, 0.6), 0 0 10px rgba(59, 130, 246, 0.3); }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
    .playground-grid, .api-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .pricing-card.recommended {
        transform: none;
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 3rem 0;
    }
    
    .section {
        padding: var(--section-padding);
    }
    
    h1 {
        font-size: 2.15rem;
        line-height: 1.25;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin: 1rem auto 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 1rem;
    }
    
    /* Header adaptations */
    .nav-links {
        display: none; /* Hide desktop nav menu */
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
    
    /* Sleek scrollable tabs header for mobile, preventing awkward line wrapping */
    .tabs-header {
        overflow-x: auto;
        white-space: nowrap;
        display: flex;
        gap: 0.25rem;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        padding: 0.6rem 0.85rem;
        font-size: 0.85rem;
        flex-shrink: 0;
    }
    
    .glass-card {
        padding: 1.25rem;
        border-radius: 16px;
    }
    
    .control-row {
        flex-direction: column;
        gap: 0;
    }
    
    .settings-sliders {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    /* Dynamic 2-column mobile card view for compact screen scanning */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .voice-card {
        padding: 1rem;
        height: 220px;
        border-radius: 12px;
    }
    
    .voice-card-header {
        margin-bottom: 0.75rem;
    }
    
    .voice-card h4 {
        font-size: 1rem;
    }
    
    .voice-tagline {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .voice-card-desc {
        font-size: 0.75rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }
    
    .voice-card-footer {
        font-size: 0.65rem;
        padding-top: 0.5rem;
    }
    
    /* Volume player controls */
    .player-controls {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .volume-control {
        width: 100%;
    }
    
    .output-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Code documentation wrapper */
    .api-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .code-tabs {
        overflow-x: auto;
        white-space: nowrap;
        display: flex;
        -webkit-overflow-scrolling: touch;
    }
    
    .code-tab {
        flex-shrink: 0;
    }
    
    .code-block-wrapper {
        padding: 1rem;
    }
    
    .code-block {
        font-size: 0.75rem;
    }
    
    /* Footer elements */
    .footer-container {
        flex-direction: column;
        gap: 2.5rem;
    }
    
    .footer-links-grid {
        flex-direction: column;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr; /* Switch to single column on ultra-compact mobile */
    }
    
    .voice-card {
        height: auto;
        min-height: 180px;
    }
    
    .pricing-card {
        padding: 1.5rem;
    }
}
