/* Global Reset */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-dark: #0f172a;
    --panel-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --accent-glow: rgba(37, 99, 235, 0.2);
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

/* Header */
.app-header {
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.controls-top {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 99px;
    background-color: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #64748b; /* Disconnected */
    transition: background-color 0.3s ease;
}

.connection-status.connected .status-dot {
    background-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.connection-status.connecting .status-dot {
    background-color: #eab308;
    animation: pulse 1s infinite;
}

.connection-status.error .status-dot {
    background-color: #ef4444;
}

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

/* Switches */
.switch-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.switch-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* NEW: Split Container */
.split-container {
    flex: 1;
    display: flex;
    position: relative;
    width: 100%;
    height: calc(100vh - 140px); /* Header 60 + Footer 80 */
    gap: 2px; /* Divider line */
}

/* Panel Styles */
.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--panel-bg);
    position: relative;
    overflow: hidden;
}

.source-panel {
    border-right: 1px solid var(--border-color);
}

.panel-header {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(30, 41, 59, 0.95);
    z-index: 10;
}

.panel-header h2 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lang-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    background-color: rgba(255,255,255,0.05);
    color: var(--text-secondary);
}

/* Panel Content */
.panel-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    font-size: 1.5rem; /* Large readable text */
    line-height: 1.6;
    color: var(--text-primary);
    scroll-behavior: smooth;
    word-break: break-word;
}

/* Different styling for source text to differentiate */
.source-panel .panel-content {
    font-family: serif; /* Optional contrast */
    color: #cbd5e1;
}

.target-panel .panel-content {
    font-weight: 500;
    color: var(--text-primary);
}

/* Empty State */
.empty-state {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    opacity: 0.5;
}

/* Footer Commands */
.app-footer {
    height: 80px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-dark);
}

.control-btn {
    padding: 12px 32px;
    border-radius: 99px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

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

#start-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--accent-glow);
}

#stop-btn {
    background-color: #ef4444;
    color: white;
}

#stop-btn:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

.hidden {
    display: none !important;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Audio Waves Visualization */
.audio-waves {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 20px;
    vertical-align: middle;
    margin-left: 8px;
}

.wave-bar {
    width: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
    animation: wave 1s infinite ease-in-out;
}

.wave-bar:nth-child(1) { height: 60%; animation-delay: 0s; }
.wave-bar:nth-child(2) { height: 100%; animation-delay: 0.1s; }
.wave-bar:nth-child(3) { height: 60%; animation-delay: 0.2s; }

@keyframes wave {
    0%, 100% { transform: scaleY(0.6); opacity: 0.6; }
    50% { transform: scaleY(1); opacity: 1; }
}