* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0f172a;
    color: #f1f5f9;
    min-height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 16px 24px;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

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

.tool-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 600;
}

.tool-actions {
    display: flex;
    gap: 12px;
}

.mic-select {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    min-width: 200px;
    max-width: 250px;
}

.mic-select option {
    background: #1e293b;
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Status Section */
.status-section {
    margin-bottom: 24px;
}

.status-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 32px;
    background: #1e293b;
    border-radius: 16px;
    border: 2px solid #334155;
    transition: all 0.3s;
}

.status-card.idle {
    border-color: #475569;
}

.status-card.active {
    border-color: #22c55e;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.status-card.error {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.05) 100%);
}

.status-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #334155;
    border-radius: 50%;
    font-size: 28px;
}

.status-card.idle .status-icon {
    color: #94a3b8;
}

.status-card.active .status-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    animation: pulse 2s infinite;
}

.status-card.error .status-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.status-text h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.status-text p {
    color: #94a3b8;
    font-size: 14px;
}

/* Start Section */
.start-section {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.start-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 48px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(34, 197, 94, 0.4);
}

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

.start-btn.hidden {
    display: none;
}

/* Visualization Section */
.visual-section {
    display: grid;
    gap: 20px;
}

.visual-section.hidden {
    display: none;
}

/* Cards */
.meter-card,
.waveform-card,
.spectrum-card,
.record-card,
.diagnostics-card {
    background: #1e293b;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #334155;
}

.meter-card h3,
.waveform-card h3,
.spectrum-card h3,
.record-card h3,
.diagnostics-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #e2e8f0;
}

.meter-card h3 i { color: #22c55e; }
.waveform-card h3 i { color: #3b82f6; }
.spectrum-card h3 i { color: #8b5cf6; }
.record-card h3 i { color: #ef4444; }
.diagnostics-card h3 i { color: #f59e0b; }

/* Volume Meter */
.volume-meter {
    height: 40px;
    background: #0f172a;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.volume-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #22c55e 0%, #eab308 60%, #ef4444 100%);
    border-radius: 20px;
    transition: width 0.05s ease-out;
}

.volume-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
}

.volume-value {
    text-align: center;
    margin-top: 12px;
    font-size: 32px;
    font-weight: 700;
    color: #22c55e;
}

/* Canvas */
.waveform-canvas,
.spectrum-canvas {
    width: 100%;
    height: 150px;
    background: #0f172a;
    border-radius: 12px;
}

/* Recording */
.record-info {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 16px;
}

.record-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.record-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #334155;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.record-btn:hover {
    background: #475569;
}

.record-btn.recording {
    background: #ef4444;
    animation: recording-pulse 1s infinite;
}

@keyframes recording-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.record-timer {
    font-size: 24px;
    font-weight: 600;
    font-family: monospace;
    color: #ef4444;
}

.record-timer.hidden {
    display: none;
}

.playback-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #334155;
}

.playback-section.hidden {
    display: none;
}

.audio-player {
    flex: 1;
    height: 40px;
    border-radius: 8px;
}

.audio-player::-webkit-media-controls-panel {
    background: #334155;
}

.delete-btn {
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Diagnostics */
.diagnostics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.diagnostic-item {
    background: #0f172a;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

.diagnostic-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.diagnostic-value {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #e2e8f0;
}

/* Stop Section */
.stop-section {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.stop-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 40px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

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

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 12px;
    }

    .tool-title {
        font-size: 18px;
        order: 1;
        flex: 1;
    }

    .back-btn {
        order: 0;
        padding: 8px 12px;
    }

    .back-btn span {
        display: none;
    }

    .tool-actions {
        order: 2;
        width: 100%;
    }

    .mic-select {
        width: 100%;
        max-width: none;
    }

    .main-content {
        padding: 16px;
    }

    .status-card {
        padding: 16px 20px;
        flex-direction: column;
        text-align: center;
    }

    .status-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }

    .start-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
        font-size: 16px;
    }

    .stop-btn {
        width: 100%;
        justify-content: center;
    }

    .waveform-canvas,
    .spectrum-canvas {
        height: 120px;
    }

    .volume-value {
        font-size: 28px;
    }

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

@media (max-width: 480px) {
    .tool-title {
        font-size: 16px;
    }

    .tool-title i {
        display: none;
    }

    .status-text h2 {
        font-size: 18px;
    }

    .volume-value {
        font-size: 24px;
    }

    .waveform-canvas,
    .spectrum-canvas {
        height: 100px;
    }

    .record-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .record-btn {
        justify-content: center;
    }

    .playback-section {
        flex-direction: column;
    }

    .audio-player {
        width: 100%;
    }
}

/* FAQ Section */
.faq-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #334155;
}

.faq-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #e2e8f0;
}

.faq-title i {
    color: #8b5cf6;
}

.faq-item {
    background: #1e293b;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid #334155;
    overflow: hidden;
}

.faq-item summary {
    padding: 18px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #e2e8f0;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

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

.faq-item summary::after {
    content: '+';
    font-size: 24px;
    font-weight: 300;
    color: #64748b;
    transition: transform 0.3s;
}

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

.faq-item summary:hover {
    background: rgba(139, 92, 246, 0.1);
}

.faq-item p,
.faq-item ul {
    padding: 0 24px 18px;
    color: #94a3b8;
    line-height: 1.7;
    font-size: 15px;
}

.faq-item ul {
    padding-left: 48px;
    margin-top: 8px;
}

.faq-item li {
    margin-bottom: 8px;
}

.faq-item strong {
    color: #e2e8f0;
}

/* Info Section */
.info-section {
    margin-top: 48px;
    padding: 32px;
    background: #1e293b;
    border-radius: 16px;
    border: 1px solid #334155;
}

.info-section h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #e2e8f0;
}

.info-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: #e2e8f0;
}

.info-section p {
    color: #94a3b8;
    line-height: 1.7;
    font-size: 15px;
    margin-bottom: 12px;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 10px 0;
    padding-left: 28px;
    position: relative;
    color: #94a3b8;
    line-height: 1.6;
}

.feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #22c55e;
    font-weight: bold;
}

.feature-list strong {
    color: #e2e8f0;
}

/* Footer */
.footer {
    margin-top: 48px;
    padding: 24px;
    text-align: center;
    border-top: 1px solid #334155;
    color: #64748b;
    font-size: 14px;
}

/* Responsive FAQ & Info */
@media (max-width: 768px) {
    .faq-section {
        margin-top: 32px;
        padding-top: 24px;
    }

    .faq-title {
        font-size: 20px;
    }

    .faq-item summary {
        padding: 14px 18px;
        font-size: 15px;
    }

    .faq-item p,
    .faq-item ul {
        padding: 0 18px 14px;
        font-size: 14px;
    }

    .info-section {
        margin-top: 32px;
        padding: 24px;
    }

    .info-section h2 {
        font-size: 20px;
    }

    .info-section h3 {
        font-size: 16px;
    }
}

/* Hidden utility */
.hidden {
    display: none !important;
}
