* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', -apple-system, sans-serif; background: #1a1a2e; color: #e0e0e0; min-height: 100vh; }
.app { max-width: 900px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; height: 100vh; }

.header { text-align: center; padding: 10px 0; border-bottom: 1px solid #333; }
.header h1 { font-size: 1.3rem; color: #64b5f6; }
.header .subtitle { font-size: 0.8rem; color: #888; font-weight: normal; }

.settings { padding: 10px 0; border-bottom: 1px solid #333; }
.setting-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.setting-row:last-child { margin-bottom: 0; }
.setting-row label { font-size: 0.85rem; color: #aaa; min-width: 50px; }
.input-group { display: flex; flex: 1; gap: 4px; }
.input-group input { flex: 1; }
input, select { background: #2a2a3e; border: 1px solid #444; color: #e0e0e0; padding: 6px 10px; border-radius: 4px; font-size: 0.85rem; }
input:focus, select:focus { outline: none; border-color: #64b5f6; }

.btn { padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-size: 0.9rem; font-weight: 500; transition: all 0.2s; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-start { background: #2e7d32; color: white; }
.btn-start:hover:not(:disabled) { background: #388e3c; }
.btn-stop { background: #c62828; color: white; }
.btn-stop:hover:not(:disabled) { background: #d32f2f; }
.btn-fullscreen { background: #1565c0; color: white; margin-left: auto; }
.btn-fullscreen:hover { background: #1976d2; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; background: #2a2a3e; color: #aaa; border: 1px solid #444; border-radius: 4px; cursor: pointer; }
.btn-sm:hover { background: #3a3a4e; color: #e0e0e0; }
.btn-icon { background: #2a2a3e; border: 1px solid #444; color: #aaa; padding: 4px 8px; border-radius: 4px; cursor: pointer; }

.controls { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.status { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.status-idle .status-dot { background: #666; }
.status-listening .status-dot { background: #4caf50; animation: pulse 1.5s infinite; }
.status-translating .status-dot { background: #ff9800; animation: pulse 0.8s infinite; }
.status-error .status-dot { background: #f44336; }
.status-waiting .status-dot { background: #2196f3; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Audio Monitor */
.monitor-section { padding: 6px 0; }
.monitor-row { display: flex; align-items: center; gap: 8px; }
.monitor-label { font-size: 0.7rem; color: #888; text-transform: uppercase; min-width: 30px; letter-spacing: 1px; }
.level-bar-container { flex: 1; height: 6px; background: #16162a; border-radius: 3px; overflow: hidden; }
.level-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #4caf50, #8bc34a, #ffeb3b, #ff9800, #f44336); border-radius: 3px; transition: width 0.1s ease; }
.level-value { font-size: 0.7rem; color: #888; min-width: 24px; text-align: right; font-family: monospace; }

/* Live Caption - Teams-like */
.caption-section { padding: 8px 0; }
.caption-section .section-label { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: #888; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.live-badge { background: #f44336; color: white; font-size: 0.6rem; padding: 1px 6px; border-radius: 3px; font-weight: 700; letter-spacing: 1px; animation: pulse 1.5s infinite; }
.caption-display {
  background: #2a2a3e; border: 1px solid #444; border-radius: 8px;
  padding: 14px 18px; min-height: 56px;
  font-size: 1.15rem; line-height: 1.6; color: #ffeb3b; font-weight: 500;
}
.caption-display .placeholder { color: #555; font-weight: normal; font-style: italic; font-size: 0.95rem; }

/* Transcript */
.transcript-section { flex: 1; display: flex; flex-direction: column; min-height: 0; padding-top: 6px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.section-label { font-size: 0.8rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }
.section-actions { display: flex; gap: 4px; }
.transcript-container { flex: 1; overflow-y: auto; background: #16162a; border: 1px solid #333; border-radius: 8px; padding: 8px; }
.transcript-container::-webkit-scrollbar { width: 6px; }
.transcript-container::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
.empty-state { color: #555; text-align: center; padding: 40px 20px; font-style: italic; }

/* Entry - translation prominent, original subtle */
.entry { padding: 10px 12px; margin-bottom: 6px; background: #1e1e36; border-radius: 6px; border-left: 3px solid #64b5f6; animation: slideIn 0.3s ease; }
.entry.new-entry { border-left-color: #4caf50; background: #1e2436; }
.entry.whisper-entry { border-left-color: #ff9800; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.entry-header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.entry-time { font-size: 0.7rem; color: #555; font-family: monospace; }
.entry-source { font-size: 0.6rem; padding: 1px 5px; border-radius: 3px; font-weight: 600; }
.entry-source.src-live { background: rgba(76,175,80,0.2); color: #4caf50; }
.entry-source.src-whisper { background: rgba(255,152,0,0.2); color: #ff9800; }
.entry-original { font-size: 0.82rem; color: #78909c; margin-bottom: 8px; line-height: 1.4; padding-left: 8px; border-left: 2px solid #333; }
.entry-translation { font-size: 1.15rem; color: #a5d6a7; font-weight: 500; line-height: 1.5; }
.entry-translation.translating { color: #ff9800; font-style: italic; font-weight: normal; font-size: 0.9rem; }
.entry-translation.translating::after { content: ''; animation: dots 1.5s infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.entry-translation.error { color: #ef5350; font-size: 0.9rem; }

.footer { display: flex; justify-content: space-between; padding: 8px 0; font-size: 0.8rem; color: #666; border-top: 1px solid #333; margin-top: 6px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #323248; color: #e0e0e0; padding: 10px 20px; border-radius: 8px; font-size: 0.9rem; z-index: 1000; border: 1px solid #444; animation: toastIn 0.3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ========== Fullscreen Subtitle ========== */
.fullscreen-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: #000; z-index: 9999; display: flex; flex-direction: column; }
.fs-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; background: rgba(255,255,255,0.05); }
.fs-status { font-size: 0.85rem; color: #4caf50; }
.fs-controls { display: flex; align-items: center; gap: 8px; }
.fs-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #ccc; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 0.85rem; }
.fs-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
.fs-btn.fs-close { color: #f44336; border-color: #f44336; }
.fs-btn.fs-close:hover { background: #f44336; color: #fff; }
.fs-font-size { font-size: 0.8rem; color: #888; min-width: 40px; text-align: center; }
.fs-caption { padding: 8px 40px; color: #ffeb3b; font-size: 1rem; min-height: 32px; background: rgba(255,255,0,0.03); border-bottom: 1px solid rgba(255,255,255,0.05); }
.fs-content { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding: 24px 40px; overflow-y: auto; }
.fs-entry { margin-bottom: 12px; animation: fsFadeIn 0.5s ease; color: #fff; font-weight: 500; line-height: 1.5; text-shadow: 0 2px 8px rgba(0,0,0,0.8); }
.fs-entry.old { color: #555; font-weight: normal; }
@keyframes fsFadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.fs-empty { color: #444; text-align: center; font-style: italic; font-size: 1.2rem; align-self: center; }
.fs-original { padding: 10px 40px; background: rgba(255,255,255,0.03); border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.85rem; color: #555; min-height: 40px; }

@media (max-width: 600px) {
  .app { padding: 8px; }
  .setting-row { flex-direction: column; align-items: stretch; }
  .controls { flex-wrap: wrap; }
  .btn-fullscreen { margin-left: 0; flex: 1; }
  .status { width: 100%; justify-content: center; }
  .fs-content { padding: 16px; }
  .fs-original { padding: 8px 16px; }
  .fs-caption { padding: 8px 16px; }
}
