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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

.connection-panel {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.input-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
    flex: 1;
    max-width: 200px;
}

.input-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
}

.input-group input,
.input-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s;
}

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

.btn.primary {
    background-color: #007bff;
    color: white;
}

.btn.primary:hover:not(:disabled) {
    background-color: #0056b3;
}

.btn.secondary {
    background-color: #6c757d;
    color: white;
}

.btn.secondary:hover:not(:disabled) {
    background-color: #545b62;
}

.status-panel {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.label {
    font-weight: 600;
    color: #555;
}

.status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status.connected {
    background-color: #d4edda;
    color: #155724;
}

.status.disconnected {
    background-color: #f8d7da;
    color: #721c24;
}

.status.active {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status.inactive {
    background-color: #e2e3e5;
    color: #383d41;
}

.audio-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.audio-btn {
    background-color: #28a745;
    color: white;
    padding: 12px 24px;
    font-size: 16px;
}

.audio-btn:hover:not(:disabled) {
    background-color: #218838;
}

.audio-btn.muted {
    background-color: #dc3545;
}

.audio-btn.muted:hover:not(:disabled) {
    background-color: #c82333;
}

.transcribe-btn {
    background-color: #17a2b8 !important;
}

.transcribe-btn:hover:not(:disabled) {
    background-color: #138496 !important;
}

.transcribe-btn.active {
    background-color: #dc3545 !important;
}

.transcribe-btn.active:hover:not(:disabled) {
    background-color: #c82333 !important;
}

.transcript-panel {
    margin-bottom: 20px;
    border-top: 2px solid #e9ecef;
    padding-top: 20px;
}

.transcript-panel h3 {
    margin-bottom: 15px;
    color: #555;
}

#transcriptContainer {
    max-height: 300px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.transcript-entry {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    background: white;
    border-left: 4px solid #007bff;
}

.transcript-entry.interim {
    background: #fff3cd;
    border-left-color: #ffc107;
    opacity: 0.8;
}

.transcript-entry.final {
    background: #d4edda;
    border-left-color: #28a745;
}

.transcript-time {
    color: #6c757d;
    font-size: 11px;
    margin-right: 8px;
}

.transcript-speaker {
    font-weight: 600;
    color: #007bff;
    margin-right: 8px;
}

.transcript-text {
    color: #333;
}

.transcript-interim-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    background: #ffc107;
    color: white;
    font-size: 10px;
    border-radius: 10px;
    font-weight: 600;
}

#transcriptContainer:empty::before {
    content: "No transcripts yet. Click 'Start Transcription' and begin speaking...";
    color: #6c757d;
    font-style: italic;
}

.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.stat-item {
    text-align: center;
}

.stat-item .label {
    display: block;
    font-size: 12px;
    margin-bottom: 5px;
}

.stat-item span:last-child {
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
}

.log-panel {
    border-top: 2px solid #e9ecef;
    padding-top: 20px;
}

.log-panel h3 {
    margin-bottom: 15px;
    color: #555;
}

#logContainer {
    max-height: 200px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
}

.log-entry {
    margin-bottom: 5px;
    padding: 2px 0;
}

.log-entry.info {
    color: #007bff;
}

.log-entry.success {
    color: #28a745;
}

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

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

@media (max-width: 600px) {
    .container {
        margin: 10px;
        padding: 15px;
    }
    
    .connection-panel {
        flex-direction: column;
        align-items: stretch;
    }
    
    .status-panel {
        flex-direction: column;
        gap: 15px;
    }
    
    .audio-controls {
        flex-direction: column;
    }
    
    .stats-panel {
        grid-template-columns: 1fr;
    }
}
