:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --text-light: #64748b;
    --border: #e2e8f0;
}

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

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

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    color: var(--text);
}

.language-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.lang-btn {
    padding: 10px 20px;
    border: 2px solid var(--border);
    background: var(--surface);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.lang-btn:hover {
    border-color: var(--primary);
}

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

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    background: #f1f5f9;
    color: var(--text-light);
}

.status-badge.connected {
    background: #dcfce7;
    color: #166534;
}

.status-badge.disconnected {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.speaking {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.processing {
    background: #fef3c7;
    color: #92400e;
}

.status-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.card {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.tab {
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-light);
    border-radius: 6px;
    transition: all 0.2s;
}

.tab:hover {
    background: #f1f5f9;
}

.tab.active {
    background: #eff6ff;
    color: var(--primary);
}

.visualizer {
    height: 80px;
    background: #f1f5f9;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

.visualizer .bar {
    width: 4px;
    margin: 0 1px;
    background: var(--primary);
    border-radius: 2px;
    transition: height 0.1s;
    height: 10%;
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.btn-primary, .btn-danger, .btn-warning {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 140px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-primary:hover, .btn-danger:hover, .btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:disabled, .btn-danger:disabled, .btn-warning:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.hidden {
    display: none !important;
}

.hint {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 10px;
}

.current-language {
    text-align: center;
    font-weight: 500;
    margin-top: 10px;
    color: var(--text);
}

/* Mode Selector */
.mode-selector {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.mode-selector-header {
    text-align: center;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
}

.mode-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}

.mode-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.mode-description {
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
    min-height: 20px;
}

/* Upload Interface */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: var(--primary);
}

.upload-hint {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 5px;
}

.upload-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.language-select {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
}

.file-info {
    text-align: center;
    margin-top: 10px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Conversation */
.conversation {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    max-width: 85%;
}

.message.user {
    background: var(--primary);
    color: white;
    margin-left: auto;
}

.message.ai {
    background: #f1f5f9;
    color: var(--text);
    margin-right: auto;
}

.message.system {
    background: #fef3c7;
    color: #92400e;
    margin: 10px auto;
    text-align: center;
    max-width: 90%;
    font-size: 0.9rem;
}

.message-label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 5px;
    opacity: 0.8;
}

/* Logs */
.logs {
    background: #1e293b;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    height: 200px;
    overflow-y: auto;
    margin-top: 20px;
}

.log-entry {
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #334155;
}

.log-time {
    color: #94a3b8;
    margin-right: 10px;
}

.detection-result {
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    background: #dbeafe;
    border-radius: 6px;
    color: #1e40af;
}
.queue-status {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    min-height: 1.5rem;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f8fafc;
    display: inline-block;
    margin-left: auto;
    margin-right: auto;
    display: none; /* Hidden by default */
}

.bar.ai-speaking {
    background-color: #8b5cf6 !important;
}

.bar.disabled {
    background-color: #9ca3af !important;
    opacity: 0.5;
}
/* Add to styles.css */
.status-badge.recording {
    background-color: #fef3c7;
    color: #92400e;
    animation: pulse 1.5s infinite;
}

.status-badge.auto-recording {
    background-color: #10b981;
    color: white;
    animation: pulse 1s infinite;
}

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