/* ============================================
   INTERACTIVE DEMO PANEL
   ============================================ */

.interactive-demo-section {
    padding: 6rem 0;
    background: radial-gradient(circle at 50% 50%, rgba(220, 38, 38, 0.05) 0%, transparent 70%);
}

.demo-panel {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(22, 24, 29, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.demo-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-window-controls {
    display: flex;
    gap: 8px;
}

.demo-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.demo-panel-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.demo-panel-status {
    font-size: 0.8rem;
    color: var(--brand-green);
    display: flex;
    align-items: center;
    gap: 6px;
}

.demo-panel-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-green);
    box-shadow: 0 0 8px var(--brand-green);
}

.demo-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 1rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.demo-tab svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.demo-tab:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.demo-tab.active {
    background: rgba(220, 38, 38, 0.1);
    border-bottom-color: var(--accent-color);
    color: var(--accent-color);
}

.demo-content {
    min-height: 500px;
    position: relative;
}

.demo-panel-view {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

.demo-panel-view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Panel */
.demo-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.demo-message {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    max-width: 80%;
}

.demo-message.user {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.3);
    margin-left: auto;
    color: var(--text-primary);
}

.demo-message.ai {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-right: auto;
}

.demo-message.ai p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.demo-code {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.demo-code-line {
    line-height: 1.6;
    color: #d4d4d4;
}

.code-keyword {
    color: #569cd6;
}

.code-string {
    color: #ce9178;
}

.code-comment {
    color: #6a9955;
}

.demo-run-btn {
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.demo-run-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.demo-input-area {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.demo-input-area input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
}

.demo-input-area input::placeholder {
    color: var(--text-muted);
}

.demo-input-area button {
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Script Editor */
.demo-script-editor {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

.demo-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-editor-header span {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.demo-editor-actions {
    display: flex;
    gap: 0.75rem;
}

.demo-icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.demo-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.demo-editor-content {
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.8;
}

/* Library */
.demo-library-grid {
    display: grid;
    gap: 2rem;
}

.demo-library-category h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.demo-library-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.demo-library-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(220, 38, 38, 0.3);
}

.demo-library-item span {
    color: var(--text-primary);
}

/* Telemetry */
.demo-telemetry-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.demo-stat {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.demo-stat-value {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.demo-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.demo-error-log {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

.demo-log-header {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 600;
    color: var(--text-primary);
}

.demo-log-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.demo-log-item:last-child {
    border-bottom: none;
}

.demo-log-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
}

.demo-log-item.success .demo-log-icon {
    background: rgba(34, 197, 94, 0.2);
    color: var(--brand-green);
}

.demo-log-item.error .demo-log-icon {
    background: rgba(220, 38, 38, 0.2);
    color: var(--accent-color);
}

.demo-log-text {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.demo-log-time {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ============================================
   AUDIO OVERVIEW SECTION
   ============================================ */

.audio-overview-section {
    padding: 6rem 0;
    background: var(--bg-surface);
}

.audio-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: center;
}

.audio-info h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.audio-info p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.audio-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.audio-player {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
}

.audio-waveform {
    position: relative;
    height: 120px;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

#waveform-canvas {
    width: 100%;
    height: 100%;
}

.audio-playhead {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
    pointer-events: none;
    transition: left 0.1s linear;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.audio-play-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.audio-play-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    transform: scale(1.05);
}

.audio-play-btn svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

.audio-play-btn .pause-icon.hidden,
.hidden {
    display: none;
}

.audio-time {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.audio-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.audio-progress-fill {
    height: 100%;
    background: var(--accent-color);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.audio-volume-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.audio-volume-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.audio-volume-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
}

.audio-volume-btn.muted {
    background: rgba(220, 38, 38, 0.14);
    border-color: rgba(220, 38, 38, 0.4);
}

.audio-volume-btn.muted svg {
    stroke: var(--accent-color);
}

.audio-status {
    margin-top: 0.85rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.audio-direct-link {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .demo-tabs {
        overflow-x: auto;
    }

    .demo-tab {
        flex: 0 0 auto;
        min-width: 120px;
    }

    .audio-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .demo-telemetry-stats {
        grid-template-columns: 1fr;
    }
}
