/* ═══════════════════════════════════════
   VoiceLab — Design System
   ═══════════════════════════════════════ */

/* ── LIGHT THEME ── */
.theme-light {
    --bg-base:        #f0f4f8;
    --bg-surface:     #ffffff;
    --bg-surface-2:   #f7f9fc;
    --bg-surface-3:   #eef2f7;
    --border:         #e2e8f0;
    --border-strong:  #cbd5e1;
    --text-primary:   #0f172a;
    --text-secondary: #475569;
    --text-muted:     #94a3b8;
    --accent:         #2563eb;
    --accent-dim:     rgba(37,99,235,0.08);
    --accent-muted:   rgba(37,99,235,0.35);
    --accent-hover:   rgba(37,99,235,0.14);
    --glow-soft:      rgba(37,99,235,0.06);
    --shadow-sm:      0 1px 2px rgba(0,0,0,0.05);
    --shadow:         0 1px 4px rgba(0,0,0,0.07), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-lg:      0 8px 30px rgba(0,0,0,0.10);
    background: var(--bg-base);
    color: var(--text-secondary);
    font-family: 'Heebo', sans-serif;
}

/* ── DARK THEME ── */
/* ── DARK THEME (World Class Edition) ── */
.theme-dark {
    /* פלטת צבעים עמוקה ומקצועית */
    --bg-base:          #020617; /* כמעט שחור, עומק מקסימלי */
    --bg-surface:       #0f172a; /* צבע הסטודיו */
    --bg-surface-2:     #1e293b;
    --bg-surface-3:     #334155;
    
    /* ה-Cyan החדש: משדר בינה מלאכותית וחדשנות */
    --accent:           #38bdf8; 
    --accent-dim:       rgba(56, 189, 248, 0.12);
    --accent-muted:     rgba(56, 189, 248, 0.3);
    --accent-glow:      rgba(56, 189, 248, 0.15);
    
    --text-primary:     #f8fafc;
    --text-secondary:   #cbd5e1;
    --text-muted:       #64748b;
    
    --border:           rgba(255, 255, 255, 0.05);
    --border-strong:    rgba(255, 255, 255, 0.1);
    
    --shadow-lg:        0 20px 50px rgba(0, 0, 0, 0.6);
    
    background: var(--bg-base);
    color: var(--text-secondary);
}

/* אפקט זכוכית (Glassmorphism) לסיידברים */
.theme-dark .file-sidebar, 
.theme-dark .chat-drawer {
    background: rgba(15, 23, 42, 0.7) !important;
    backdrop-filter: blur(20px) saturate(180%);
    border-left: 1px solid var(--border) !important;
}

/* מצב מיקוד (Focus Mode) - לריכוז מקסימלי */
body.focus-mode .file-sidebar,
body.focus-mode .app-header {
    opacity: 0;
    pointer-events: none;
    transition: 0.5s ease;
}
/* Scanlines - dark only */
.theme-dark .scanlines {
    pointer-events: none; position: fixed; inset: 0; z-index: 9999;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.018) 2px, rgba(0,0,0,0.018) 4px);
}
.theme-light .scanlines { display: none; }

/* Grid */
.grid-bg {
    background-size: 40px 40px;
    background-image: linear-gradient(to right, var(--border) 1px, transparent 1px), linear-gradient(to bottom, var(--border) 1px, transparent 1px);
}

/* Scrollbar */
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

/* Loader */
.loader-ring { position: relative; display: flex; align-items: center; justify-content: center; }
.loader-arc { animation: loaderSpin 1.2s linear infinite; transform-origin: center; transform-box: fill-box; }
@keyframes loaderSpin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:translateY(0); } }
.animate-fade-in { animation: fadeUp 0.25s ease-out forwards; }

/* ── HEADER ── */
.app-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.logo-icon { background: var(--accent-dim); border: 1px solid var(--accent-muted); }
.logo-icon i { color: var(--accent); }

/* Header stat pills */
.stat-pill {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 7px; border-radius: 20px;
    font-size: 0.65rem; font-weight: 700;
    border: 1px solid var(--border);
    background: var(--bg-surface-2);
    color: var(--text-muted);
    transition: all 0.2s;
}
.stat-pill.has-value.waiting  { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.3); color: #d97706; }
.stat-pill.has-value.processing { background: rgba(59,130,246,0.08); border-color: rgba(59,130,246,0.3); color: #2563eb; }
.stat-pill.has-value.success  { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.3); color: #059669; }
.stat-pill.has-value.error    { background: rgba(239,68,68,0.08);  border-color: rgba(239,68,68,0.3);  color: #dc2626; }

/* ── BUTTONS ── */
.btn-primary {
    background: var(--accent); color: #fff;
    font-size: 0.72rem; transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(37,99,235,0.3);
}
.btn-primary:hover { opacity: 0.9; box-shadow: 0 2px 8px rgba(37,99,235,0.4); }

.icon-btn {
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); color: var(--text-muted);
    background: transparent; transition: all 0.15s;
}
.icon-btn:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--bg-surface-2); }

.btn-accent-sm {
    background: var(--accent-dim); border: 1px solid var(--accent-muted);
    color: var(--accent); transition: all 0.15s; white-space: nowrap;
}
.btn-accent-sm:hover { background: var(--accent-hover); }

.export-btn {
    font-size: 0.65rem; font-weight: 700; color: var(--text-muted);
    padding: 4px 10px; border-radius: 6px;
    border: 1px solid var(--border); background: transparent;
    transition: all 0.2s; font-family: 'JetBrains Mono', monospace;
}
.export-btn:hover { color: var(--accent); border-color: var(--accent-muted); background: var(--accent-dim); }

/* ── MODAL ── */
.modal-backdrop { background: rgba(0,0,0,0.35); backdrop-filter: blur(4px); }
.modal-box { background: var(--bg-surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); }

/* ── SETTINGS ── */
.settings-label {
    display: block; font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem; color: var(--text-muted);
    margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.07em;
}
.settings-input {
    background: var(--bg-surface-2); border: 1px solid var(--border-strong);
    border-radius: 8px; padding: 8px 10px; font-size: 0.78rem;
    color: var(--text-primary); font-family: 'JetBrains Mono', monospace;
    transition: border-color 0.2s; outline: none;
}
.settings-input:focus { border-color: var(--accent-muted); }
.settings-input::placeholder { color: var(--text-muted); }
select.settings-input option { background: var(--bg-surface); }

/* ── DROP ZONE ── */
.drop-zone-box { border: 2px dashed var(--border-strong); transition: all 0.25s; }
.drop-zone-box:hover, .drop-zone-box.drag-over { border-color: var(--accent-muted); background: var(--accent-dim); }
.drop-zone-box:hover .drop-icon { border-color: var(--accent-muted); }
.drop-zone-box:hover .fa-waveform-lines { color: var(--accent) !important; }
.drop-icon { background: var(--bg-surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
.feature-pill {
    display: flex; align-items: center; gap: 5px;
    padding: 5px 12px; border-radius: 20px;
    background: var(--bg-surface); border: 1px solid var(--border);
    font-size: 0.7rem; color: var(--text-secondary); box-shadow: var(--shadow-sm);
}

/* ── TABS ── */
.tab-bar { background: var(--bg-surface); border-bottom: 1px solid var(--border); }
.tab-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 4px 12px; font-size: 0.7rem; font-weight: 700;
    color: var(--text-muted); border-radius: 6px; border: 1px solid transparent; transition: all 0.15s;
}
.tab-btn:hover { color: var(--text-secondary); background: var(--bg-surface-2); }
.tab-btn.active { color: var(--accent); background: var(--accent-dim); border-color: var(--accent-muted); }
.tab-content { display: none !important; }
.tab-content.active { display: flex !important; }

/* ── FILE SIDEBAR ── */
.file-sidebar { background: var(--bg-surface); border-left: 1px solid var(--border); }
.sidebar-header { border-bottom: 1px solid var(--border); }

.file-item {
    padding: 8px 10px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--bg-surface-2);
    cursor: pointer; transition: all 0.15s; animation: fadeUp 0.2s ease-out;
}
.file-item:hover { background: var(--bg-surface-3); border-color: var(--border-strong); }
.file-item.active { border-color: var(--accent-muted); background: var(--accent-dim); }
.file-item.error { border-color: rgba(239,68,68,0.3); }

/* ── SUMMARY CARD ── */
.summary-card { background: var(--accent-dim); border: 1px solid var(--accent-muted); }

/* ── TRANSCRIPTION ── */
.transcription-text { color: var(--text-secondary); }
.transcription-text p { margin-bottom: 1.4em; }

/* ── EDITOR SIDEBAR ── */
.editor-sidebar { background: var(--bg-surface); border-right: 1px solid var(--border); }
.sidebar-section { border-bottom: 1px solid var(--border); }

.waveform-container { background: var(--bg-surface-3); border: 1px solid var(--border); }
.play-btn {
    background: var(--accent-dim); border: 1px solid var(--accent-muted);
    color: var(--accent); transition: all 0.15s;
}
.play-btn:hover { background: var(--accent); color: #fff; }
.sub-preview { background: var(--bg-surface-2); border: 1px solid var(--border); color: var(--text-secondary); }

/* Brain button */
.brain-btn { border: 1px solid var(--border); background: var(--bg-surface-2); transition: all 0.2s; }
.brain-btn:hover { border-color: var(--accent-muted); background: var(--accent-dim); }
.brain-icon { background: var(--accent-dim); border: 1px solid var(--accent-muted); color: var(--accent); }

/* ── EDIT ROWS ── */
.edit-row {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 10px 0; border-bottom: 1px solid var(--border); transition: all 0.1s;
}
.edit-row:last-child { border-bottom: none; }
.edit-row:hover { background: var(--bg-surface-2); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 8px; }
.edit-row.active-row { background: var(--accent-dim); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 8px; }
.edit-row .ts {
    font-family: 'JetBrains Mono', monospace; font-size: 0.6rem;
    color: var(--accent-muted); width: 42px; padding-top: 4px; flex-shrink: 0;
}
.edit-row .play-seg {
    width: 20px; height: 20px; border-radius: 50%;
    background: transparent; border: 1px solid var(--border);
    color: var(--text-muted); font-size: 0.5rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 3px; cursor: pointer; transition: all 0.15s;
}
.edit-row .play-seg:hover { background: var(--accent-dim); border-color: var(--accent-muted); color: var(--accent); }
.edit-row .play-seg.playing { background: var(--accent); border-color: var(--accent); color: #fff; }
.edit-row textarea {
    flex: 1; background: transparent; color: var(--text-primary);
    font-size: 0.9rem; line-height: 1.75; outline: none; resize: none;
    border: none; font-family: 'Heebo', sans-serif; min-height: 1.75em;
}

/* ── CHAT DRAWER ── */
/* ── CHAT DRAWER (Theme Matching) ── */
.chat-drawer { background: var(--bg-surface); border-right: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); }
.drawer-header { border-bottom: 1px solid var(--border); background: var(--bg-surface-2); }

#chatMessages { background-color: var(--bg-base); }
.chat-input-area { background: var(--bg-surface-2); border-top: 1px solid var(--border); }

.chat-input { background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: 24px; color: var(--text-primary); box-shadow: var(--shadow-sm); }
.chat-input::placeholder { color: var(--text-muted); }

.chat-send-btn { background: var(--accent); color: #fff; border: none; border-radius: 50%; box-shadow: var(--shadow-sm); transition: all 0.2s; }
.chat-send-btn:hover { background: var(--accent-muted); transform: scale(1.05); }

.chat-message { display: flex; margin-bottom: 12px; }
.chat-message.user { justify-content: flex-end; }
.chat-message.ai, .chat-message.model { justify-content: flex-start; }
.chat-message .bubble { padding: 8px 12px; border-radius: 8px; font-size: 0.8rem; max-width: 88%; line-height: 1.6; box-shadow: var(--shadow-sm); }

.chat-message.user .bubble { background: var(--accent-dim); color: var(--text-primary); border: 1px solid var(--accent-muted); border-radius: 12px 0 12px 12px; text-align: right; }
.chat-message.ai .bubble, .chat-message.model .bubble { background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-strong); border-radius: 0 12px 12px 12px; }

.suggestion-chip { display: block; width: 100%; background: var(--bg-surface); border: 1px solid var(--border-strong); color: var(--text-secondary); padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: all 0.15s; text-align: center; font-size: 0.75rem; font-weight: 500; }
.suggestion-chip:hover { background: var(--bg-surface-2); border-color: var(--accent-muted); color: var(--text-primary); }

.typing-indicator { display: flex; gap: 4px; align-items: center; padding: 4px 0; }
.typing-indicator span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: typingBounce 1.2s infinite; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }
.chat-speaker-tag { display: inline-block; font-size: 0.65rem; font-weight: bold; color: var(--accent); margin-bottom: 4px; }
/* Empty State "Portal" Effect */
.drop-zone-box {
    position: relative;
    border: 1px solid var(--border) !important;
    background: var(--bg-surface) !important;
    overflow: hidden;
}

.drop-zone-box::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: conic-gradient(from 0deg, transparent, var(--accent), transparent);
    animation: rotateGlow 4s linear infinite;
    opacity: 0.2;
    display: none;
}

.drop-zone-box.drag-over::before { display: block; }

@keyframes rotateGlow {
    to { transform: rotate(360deg); }
}
/* שדרוג חוויית הקריאה בתמלול */
.transcription-text {
    line-height: 1.8; /* ריווח נשימה בין שורות */
    letter-spacing: 0.01em;
    font-size: 1.05rem;
    max-width: 800px; /* רוחב אופטימלי לקריאה */
    margin: 0 auto;
}

/* הדגשת מילים בתוך הטקסט (אם יש חיפוש) */
mark {
    background: var(--accent-dim);
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    padding: 0 2px;
}
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px var(--accent-glow);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(1px);
}

/* אפקט ברק שעובר על הכפתור מדי פעם */
.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    transition: 0.5s;
    pointer-events: none;
}

.btn-primary:hover::after {
    left: 120%;
}
.theme-dark .file-sidebar, 
.theme-dark .chat-drawer,
.theme-dark .sidebar-player-panel {
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.02); /* אור חוזר מהשוליים */
}