/* Speaker Test - TechTools Dark Theme */

:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #232338;
    --bg-input: #0d0d14;

    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-secondary: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);

    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Channel Colors */
    --channel-left: #3b82f6;
    --channel-right: #f97316;
    --channel-both: #a855f7;

    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);

    /* Sizing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* App Container */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--accent-primary);
}

.title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.title-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
}

.header-spacer {
    width: 100px;
}

/* Main Content */
.main-content {
    flex: 1;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Initial State */
.initial-state {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.start-container {
    text-align: center;
    max-width: 500px;
}

.speaker-icon-large {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
}

.speaker-icon-large svg {
    width: 60px;
    height: 60px;
    color: white;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 var(--accent-glow);
    }
    50% {
        box-shadow: 0 0 0 20px transparent;
    }
}

.start-container h2 {
    font-size: 28px;
    margin-bottom: 12px;
}

.start-container .description {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 16px;
}

.privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 20px;
}

.privacy-note svg {
    width: 16px;
    height: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-large {
    padding: 16px 40px;
    font-size: 18px;
}

.btn-large svg {
    width: 24px;
    height: 24px;
}

/* Active State */
.active-state {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Visualization Container */
.visualization-container {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

#waveformCanvas {
    width: 100%;
    height: 150px;
    display: block;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
}

.channel-indicator {
    position: absolute;
    top: 30px;
    left: 30px;
    display: flex;
    gap: 10px;
}

.channel {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    opacity: 0.3;
    transition: all var(--transition-fast);
}

.channel.left {
    background: var(--channel-left);
    color: white;
}

.channel.right {
    background: var(--channel-right);
    color: white;
}

.channel.active {
    opacity: 1;
    box-shadow: 0 0 20px currentColor;
}

.frequency-display {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.freq-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'Courier New', monospace;
}

.freq-unit {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Control Sections */
.control-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.control-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.control-section h3 svg {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

/* Stereo Buttons */
.stereo-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.btn-stereo {
    flex-direction: column;
    padding: 20px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.btn-stereo:hover {
    border-color: var(--border-hover);
    background: var(--bg-secondary);
}

.btn-stereo.active {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.btn-stereo .channel-label {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.btn-left .channel-label {
    color: var(--channel-left);
}

.btn-right .channel-label {
    color: var(--channel-right);
}

.btn-both .channel-label {
    color: var(--channel-both);
}

.btn-left.active {
    border-color: var(--channel-left);
    background: rgba(59, 130, 246, 0.1);
}

.btn-right.active {
    border-color: var(--channel-right);
    background: rgba(249, 115, 22, 0.1);
}

.btn-both.active {
    border-color: var(--channel-both);
    background: rgba(168, 85, 247, 0.1);
}

/* Frequency Control */
.frequency-control {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
}

.freq-slider-container {
    flex: 1;
}

.freq-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-input);
    appearance: none;
    cursor: pointer;
}

.freq-slider::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.freq-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.freq-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
}

.freq-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.freq-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.freq-input {
    width: 100px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 16px;
    font-family: 'Courier New', monospace;
    text-align: right;
}

.freq-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.freq-input-unit {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Frequency Presets */
.freq-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.preset-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.preset-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 70px;
}

.btn-preset {
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-preset:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-preset.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Special Tests */
.special-tests {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.btn-special {
    flex-direction: column;
    padding: 20px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    gap: 8px;
}

.btn-special svg {
    color: var(--accent-primary);
}

.btn-special:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

.btn-special.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-primary);
}

.btn-desc {
    font-size: 11px;
    color: var(--text-muted);
}

/* Volume & Waveform Control Row */
.control-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.control-row > div {
    display: flex;
    flex-direction: column;
}

.control-row h3 {
    margin-bottom: 16px;
}

/* Volume Control */
.volume-slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
}

.btn-icon:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-icon.muted {
    color: var(--danger);
}

.volume-slider {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-input);
    appearance: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
}

.volume-value {
    min-width: 50px;
    text-align: right;
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
}

/* Waveform Buttons */
.waveform-buttons {
    display: flex;
    gap: 8px;
}

.btn-waveform {
    flex: 1;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
}

.btn-waveform:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-waveform.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Play Control */
.play-control {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 16px 0;
}

.btn-play {
    padding: 16px 48px;
    font-size: 18px;
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.btn-play.playing {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
}

.btn-stop {
    padding: 16px 48px;
    font-size: 18px;
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
}

.btn-stop:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

/* Info Panel */
.info-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.info-panel h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.info-panel h3 svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--accent-primary);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.info-value.status-ready {
    color: var(--success);
}

.info-value.status-playing {
    color: var(--accent-primary);
}

/* Warning Banner */
.warning-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    color: var(--warning);
    font-size: 14px;
}

.warning-banner svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* SEO Content Section */
.seo-content {
    background: var(--bg-secondary);
    padding: 60px 0;
    margin-top: 60px;
}

.seo-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.seo-content h2 {
    font-size: 28px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.seo-content > p {
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 16px;
    line-height: 1.7;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

.feature-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.feature-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

/* FAQ Section */
.faq-section {
    margin-bottom: 48px;
}

.faq-section h2 {
    margin-bottom: 24px;
}

.faq-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
    overflow: hidden;
}

.faq-item summary {
    padding: 18px 24px;
    cursor: pointer;
    font-weight: 500;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 20px;
    color: var(--accent-primary);
    transition: transform var(--transition-fast);
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item p {
    padding: 0 24px 18px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Use Cases */
.use-cases {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.use-cases h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.use-cases ul {
    list-style: none;
}

.use-cases li {
    padding: 8px 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.use-cases li:last-child {
    border-bottom: none;
}

.use-cases li strong {
    color: var(--text-primary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-muted);
    font-size: 14px;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .title {
        order: -1;
        width: 100%;
        justify-content: center;
        font-size: 20px;
    }

    .back-link {
        font-size: 13px;
    }

    .header-spacer {
        display: none;
    }

    .stereo-buttons {
        grid-template-columns: 1fr;
    }

    .special-tests {
        grid-template-columns: repeat(2, 1fr);
    }

    .control-row {
        grid-template-columns: 1fr;
    }

    .freq-presets {
        flex-direction: column;
    }

    .preset-group {
        justify-content: flex-start;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .frequency-control {
        flex-direction: column;
        align-items: stretch;
    }

    .freq-input-group {
        justify-content: center;
    }

    .waveform-buttons {
        flex-wrap: wrap;
    }

    .btn-waveform {
        flex: 1 1 calc(50% - 4px);
    }

    .channel-indicator {
        top: 15px;
        left: 15px;
    }

    .channel {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .frequency-display {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
    }

    .freq-value {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 0 12px;
    }

    .control-section {
        padding: 16px;
    }

    .btn-stereo {
        padding: 16px;
    }

    .btn-stereo .channel-label {
        font-size: 20px;
    }

    .special-tests {
        grid-template-columns: 1fr;
    }

    .btn-special {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        gap: 12px;
    }

    .btn-desc {
        margin-left: auto;
    }

    .play-control {
        flex-direction: column;
    }

    .btn-play, .btn-stop {
        width: 100%;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .speaker-icon-large {
        width: 100px;
        height: 100px;
    }

    .speaker-icon-large svg {
        width: 50px;
        height: 50px;
    }

    .start-container h2 {
        font-size: 22px;
    }
}
