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

body {
    font-family: 'Inter', 'Roboto Mono', 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    background: #0A0A0A;
    min-height: 100vh;
    color: #FFFFFF;
    line-height: 1.4;
}

.container {
    max-width: 100%;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Navigation Bar */
.top-nav {
    background: linear-gradient(180deg, #1A1A1A 0%, #111111 100%);
    border-bottom: 1px solid #333333;
    padding: 0.6rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.nav-content {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-title {
    color: #00FF88;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: 'SF Mono', 'Monaco', monospace;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.controls-section {
    background: linear-gradient(145deg, #1A1A1A 0%, #0F0F0F 100%);
    border: 1px solid #333333;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.1);
}

.section-title {
    color: #00FF88;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    border-bottom: 1px solid #333333;
    padding-bottom: 0.4rem;
}

.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.smart-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #333333;
    margin-top: 1rem;
}

.smart-toggle {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    user-select: none;
}

.smart-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #333333;
    border-radius: 12px;
    transition: background-color 0.3s;
    border: 1px solid #555555;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #FFFFFF;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.smart-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: #00FF88;
    border-color: #00FF88;
}

.smart-toggle input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: #0A0A0A;
}

.toggle-label {
    color: #CCCCCC;
    font-size: 0.85rem;
    font-family: 'SF Mono', 'Monaco', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.smart-toggle input[type="checkbox"]:checked ~ .toggle-label {
    color: #00FF88;
}

.btn-config {
    background: #2A2A2A;
    border-color: #444444;
    color: #CCCCCC;
    font-size: 0.8rem;
    padding: 0.6rem 1rem;
}

.btn-config:hover:not(:disabled) {
    background: #333333;
    border-color: #00FF88;
    color: #00FF88;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.2);
}

.test-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid #444444;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #1A1A1A;
    color: #FFFFFF;
    font-family: 'SF Mono', 'Monaco', monospace;
    position: relative;
    overflow: hidden;
}

.btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.btn:hover:before {
    left: 100%;
}

.btn .icon {
    font-size: 1em;
}

.btn-outline {
    border: 1px solid #666666;
    background: #0A0A0A;
}

.btn-outline:hover:not(:disabled) {
    border-color: #00FF88;
    background: #111111;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
}

.btn-primary {
    background: #00FF88;
    color: #0A0A0A;
    border-color: #00FF88;
    font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
    background: #00DD77;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.btn-secondary {
    background: #333333;
    border-color: #555555;
}

.btn-secondary:hover:not(:disabled) {
    background: #444444;
    border-color: #777777;
}

.btn-accent {
    background: #FF4444;
    border-color: #FF4444;
    color: #FFFFFF;
}

.btn-accent:hover:not(:disabled) {
    background: #FF3333;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.status-panel {
    background: linear-gradient(145deg, #1A1A1A 0%, #0F0F0F 100%);
    border: 1px solid #333333;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.1);
}

.connection-status .status {
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: 'SF Mono', 'Monaco', monospace;
    border: 1px solid;
}

.status.connected {
    background: rgba(0, 255, 136, 0.1);
    color: #00FF88;
    border-color: #00FF88;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.2);
}

.status.disconnected {
    background: rgba(255, 68, 68, 0.1);
    color: #FF4444;
    border-color: #FF4444;
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.2);
}

.status.error {
    background: rgba(255, 153, 0, 0.1);
    color: #FF9900;
    border-color: #FF9900;
    box-shadow: 0 0 8px rgba(255, 153, 0, 0.2);
}

.audio-level {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 0.75rem;
    color: #CCCCCC;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.level-meter {
    width: 120px;
    height: 4px;
    background: #333333;
    border: 1px solid #555555;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.level-bar {
    height: 100%;
    transition: width 0.1s ease;
    border-radius: 1px;
    position: relative;
}

.level-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    opacity: 0.7;
}

.level-bar.low {
    background: linear-gradient(90deg, #00FF88, #00DD77);
    box-shadow: 0 0 4px rgba(0, 255, 136, 0.3);
}

.level-bar.medium {
    background: linear-gradient(90deg, #FF9900, #FF8800);
    box-shadow: 0 0 4px rgba(255, 153, 0, 0.3);
}

.level-bar.high {
    background: linear-gradient(90deg, #FF4444, #FF3333);
    box-shadow: 0 0 4px rgba(255, 68, 68, 0.3);
}

.transcription-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(145deg, #1A1A1A 0%, #0F0F0F 100%);
    border: 1px solid #333333;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.transcription-header {
    padding: 1rem 1.5rem 0.8rem 1.5rem;
    border-bottom: 1px solid #333333;
}

.transcription-output {
    flex: 1;
    min-height: 300px;
    overflow-y: auto;
    padding: 1.5rem;
    background: #0A0A0A;
    line-height: 1.6;
    font-size: 0.95rem;
    font-family: 'SF Mono', 'Monaco', monospace;
    color: #FFFFFF;
    border: none;
    position: relative;
}

.transcription-output::-webkit-scrollbar {
    width: 8px;
}

.transcription-output::-webkit-scrollbar-track {
    background: #1A1A1A;
}

.transcription-output::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 4px;
}

.transcription-output::-webkit-scrollbar-thumb:hover {
    background: #555555;
}

.transcription-item {
    margin-bottom: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid #333333;
    animation: fadeIn 0.5s ease-out;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.transcription-item:last-child {
    border-bottom: none;
}

.transcription-item .timestamp {
    color: #00FF88;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.8;
}

.transcription-item .text {
    color: #FFFFFF;
    font-size: 1.1rem;
    line-height: 1.5;
}

.placeholder {
    color: #666666;
    font-style: italic;
    text-align: center;
    margin-top: 4rem;
    font-size: 0.9rem;
    opacity: 0.7;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
}

.transcript-text {
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.transcript-text:last-child {
    border-bottom: none;
}

/* Responsive design */
@media (max-width: 1024px) {
    .main-content {
        padding: 1rem;
    }

    .nav-content {
        padding: 0 1rem;
    }

    .footer-content {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 250px;
    }

    .status-panel {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        text-align: center;
    }

    .transcription-output {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .footer-section {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* Animation for new transcriptions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.new-transcript {
    animation: fadeIn 0.3s ease-out;
}

.debug-panel {
    background: linear-gradient(145deg, #1A1A1A 0%, #0F0F0F 100%);
    border: 1px solid #333333;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.debug-panel details {
    padding: 0.8rem;
}

/* Audio Testing Section - Compact Bottom Layout */
.audio-testing {
    margin-bottom: 0.5rem;
    padding: 1rem;
}

.audio-testing .section-title {
    font-size: 0.75rem;
    margin-bottom: 0.8rem;
    opacity: 0.9;
}

.audio-testing .test-controls {
    gap: 0.8rem;
}

.audio-testing .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
}

.debug-panel summary {
    cursor: pointer;
    font-weight: 500;
    color: #CCCCCC;
    padding: 0.5rem;
    margin: -0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.debug-panel summary:hover {
    background-color: #222222;
    color: #00FF88;
}

.debug-log {
    max-height: 200px;
    overflow-y: auto;
    background: #0A0A0A;
    border: 1px solid #333333;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 1rem;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
}

.debug-log::-webkit-scrollbar {
    width: 6px;
}

.debug-log::-webkit-scrollbar-track {
    background: #1A1A1A;
}

.debug-log::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 3px;
}

.log-entry {
    margin-bottom: 0.25rem;
    color: #AAAAAA;
}

.log-entry.error {
    color: #FF4444;
}

.log-entry.success {
    color: #00FF88;
}

.log-entry.warning {
    color: #FF9900;
}

/* Footer */
.footer {
    background: linear-gradient(180deg, #111111 0%, #1A1A1A 100%);
    border-top: 1px solid #333333;
    padding: 1rem 2rem;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    color: #666666;
    font-size: 0.75rem;
    font-family: 'SF Mono', 'Monaco', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-section {
    display: flex;
    gap: 2rem;
}

.footer-info {
    color: #00FF88;
}