/* ============================================================
   Quantralux Tool Style — YouTube Transcript & Summary
   ============================================================ */

:root {
  --navy: #0A1A2F; --navy-soft: #153A7A; --gold: #D4AF37; --gold-dark: #B8960F;
  --bg: #0A1A2F; --text-main: #F2F4F7; --text-muted: #B8C0CC;
  --card-bg: #FFFFFF; --card-border: rgba(21, 58, 122, 0.2);
  --btn-primary: #1E4A7A; --btn-primary-hover: #1B449B; --divider: #153A7A;
  --success: #16a34a; --danger: #dc2626; --warning: #d97706;
}
body.dark-mode {
  --navy: #0a1628; --navy-soft: #111d33; --gold: #00d4ff; --gold-dark: #0099cc;
  --bg: #0a1628; --text-main: #ffffff; --text-muted: #94a3b8;
  --card-bg: #f8f9fc; --card-border: rgba(0, 212, 255, 0.2);
  --btn-primary: #00d4ff; --btn-primary-hover: #0099cc; --divider: #153A7A;
  --success: #22c55e; --danger: #ef4444; --warning: #f59e0b;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text-main); min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; overflow-x: hidden; transition: background 0.4s ease, color 0.4s ease; }
body::before { content: ''; position: fixed; inset: 0; background: radial-gradient(ellipse at center, #1B449B 0%, #153A7A 40%, #0A1A2F 100%); z-index: -1; pointer-events: none; }
body.dark-mode::before { background: radial-gradient(ellipse at center, #0f1f38 0%, #111d33 40%, #0a1628 100%); }
a { color: inherit; text-decoration: none; } img { max-width: 100%; height: auto; } button { cursor: pointer; font-family: inherit; }
.lang-en, .lang-fr { display: none; }
.theme-toggle { position: fixed; bottom: 24px; right: 24px; width: 48px; height: 48px; border-radius: 50%; background: var(--navy-soft); border: 2px solid var(--card-border); color: var(--gold); font-size: 1.3rem; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 9998; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.theme-toggle:hover { transform: scale(1.1); border-color: var(--gold); }
.site-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 7vw; background: linear-gradient(135deg, rgba(10,26,47,0.95), rgba(21,58,122,0.98)); backdrop-filter: blur(20px); border-bottom: 2px solid var(--gold); position: sticky; top: 0; z-index: 20; }
body.dark-mode .site-header { background: linear-gradient(135deg, rgba(10,22,40,0.95), rgba(17,29,51,0.98)); }
.logo-area { display: flex; align-items: center; gap: 12px; }
.logo-mark { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg, var(--gold), var(--gold-dark)); display: flex; align-items: center; justify-content: center; color: var(--navy); font-weight: 800; font-size: 22px; box-shadow: 0 8px 18px rgba(212,175,55,0.3); }
body.dark-mode .logo-mark { box-shadow: 0 8px 18px rgba(0,212,255,0.3); }
.logo-text { display: flex; flex-direction: column; }
.logo-title { font-weight: 700; letter-spacing: 0.04em; font-size: 16px; color: var(--text-main); }
.logo-subtitle { font-size: 12px; color: var(--text-muted); }
.main-nav a { color: var(--text-muted); margin-left: 24px; font-size: 14px; font-weight: 500; position: relative; transition: color 0.2s ease; }
.main-nav a::after { content: ""; position: absolute; left: 0; bottom: -6px; width: 0; height: 2px; background: var(--gold); transition: width 0.2s ease; }
.main-nav a:hover { color: var(--gold); } .main-nav a:hover::after { width: 100%; }
main { flex: 1; }
.hero { padding: 60px 7vw 40px 7vw; display: flex; align-items: center; justify-content: center; background: transparent; }
.hero-content { max-width: 720px; text-align: center; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800; line-height: 1.25; margin-bottom: 16px; color: var(--text-main); }
.hero p { color: var(--text-muted); max-width: 620px; margin: 0 auto 24px auto; font-size: 1.05rem; line-height: 1.7; }
.section { padding: 60px 7vw; background: transparent; }
.section-tag { display: inline-block; font-size: 0.8rem; font-weight: 600; color: var(--gold); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 0.75rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 12px 28px; font-size: 15px; font-weight: 600; border: 1px solid transparent; cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease; }
.btn-primary { background: var(--btn-primary); color: #FFF; box-shadow: 0 4px 15px rgba(27,68,155,0.3); }
.btn-primary:hover { background: var(--btn-primary-hover); transform: translateY(-2px); }
body.dark-mode .btn-primary { background: var(--gold); color: var(--navy); }
body.dark-mode .btn-primary:hover { background: var(--gold-dark); }
.btn-secondary { background: transparent; border-color: var(--card-border); color: var(--gold); }
.btn-secondary:hover { background: rgba(212,175,55,0.1); border-color: var(--gold); }
body.dark-mode .btn-secondary:hover { background: rgba(0,212,255,0.1); }
.btn-sm { padding: 6px 16px; font-size: 12px; }
.back-link { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--gold); font-size: 0.9rem; font-weight: 600; margin-bottom: 1.5rem; transition: all 0.3s; }
.back-link:hover { transform: translateX(-3px); }
.site-footer { text-align: center; font-size: 12px; color: var(--text-muted); padding: 16px 7vw 20px 7vw; border-top: 1px solid var(--card-border); background: var(--navy); }
body.dark-mode .site-footer { background: linear-gradient(135deg, rgba(17,29,51,0.95), rgba(10,22,40,0.98)); }
.lang-switcher { position: fixed; top: 20px; right: 20px; background: var(--navy-soft); color: var(--gold); border: 2px solid var(--gold); padding: 10px 15px; border-radius: 25px; cursor: pointer; z-index: 1001; font-weight: 600; transition: all 0.3s ease; box-shadow: 0 2px 10px rgba(212,175,55,0.2); }
body.dark-mode .lang-switcher { box-shadow: 0 2px 10px rgba(0,212,255,0.2); }
.lang-switcher:hover { transform: scale(1.05); background: rgba(212,175,55,0.15); }
body.dark-mode .lang-switcher:hover { background: rgba(0,212,255,0.15); }
.lang-btn-en, .lang-btn-fr { display: none; }
[lang="en"] .lang-btn-fr { display: inline; }
[lang="fr"] .lang-btn-en { display: inline; }
.hamburger-menu { position: fixed; top: 20px; left: 20px; width: 35px; height: 30px; cursor: pointer; z-index: 1001; display: flex; flex-direction: column; justify-content: space-between; transition: transform 0.3s ease; }
.hamburger-menu:hover { transform: scale(1.1); }
.hamburger-menu span { display: block; height: 4px; background: var(--gold); border-radius: 2px; transition: all 0.3s ease; }
.sidebar-menu { position: fixed; top: 0; left: -300px; width: 280px; height: 100vh; background: linear-gradient(180deg, var(--navy), var(--navy-soft)); box-shadow: 2px 0 15px rgba(0,0,0,0.5); transition: left 0.3s ease; z-index: 1000; overflow-y: auto; padding: 130px 20px 20px 20px; }
body.dark-mode .sidebar-menu { background: linear-gradient(180deg, rgba(10,22,40,0.98), rgba(15,31,56,0.98)); }
.sidebar-menu.active { left: 0; }
.sidebar-menu h3 { color: var(--gold); font-size: 1em; margin: 25px 0 15px 0; padding-bottom: 8px; border-bottom: 2px solid var(--gold); text-transform: uppercase; letter-spacing: 1px; }
.sidebar-menu h3:first-child { margin-top: 0; }
.sidebar-menu a { display: block; color: var(--text-main); text-decoration: none; padding: 12px 15px; margin: 5px 0; border-radius: 8px; transition: all 0.3s ease; font-size: 1.05em; }
.sidebar-menu a:hover { background: rgba(212,175,55,0.15); transform: translateX(8px); color: var(--gold); }
body.dark-mode .sidebar-menu a:hover { background: rgba(0,212,255,0.15); }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 999; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.sidebar-overlay.active { opacity: 1; visibility: visible; }

/* ===== TOOL CONTAINER ===== */
.tool-container { background: var(--card-bg); color: #1a1a2e; border-radius: 18px; padding: 32px; border: 1px solid var(--card-border); box-shadow: 0 10px 30px rgba(0,0,0,0.3); max-width: 900px; margin: 0 auto; }
body.dark-mode .tool-container { color: #1a1a2e; }

/* ===== INPUTS ===== */
.input-group { margin-bottom: 20px; }
.input-group label { display: block; font-size: 14px; font-weight: 600; color: #1a1a2e; margin-bottom: 8px; }
body.dark-mode .input-group label { color: #1a1a2e; }
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row input { flex: 1; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--card-border); font-size: 15px; font-family: inherit; background: #f8f9fc; color: #1a1a2e; outline: none; transition: border-color 0.2s; }
.input-row input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,0.15); }
body.dark-mode .input-row input { background: #eef0f5; }
.btn-paste { font-size: 18px; padding: 10px 12px !important; min-width: 44px; }

/* ===== STATUS ===== */
.status-area { display: none; padding: 12px 18px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; font-weight: 500; }
.status-area.show { display: block; }
.status-area.loading { background: rgba(212,175,55,0.1); color: var(--gold); border: 1px solid rgba(212,175,55,0.3); }
.status-area.error { background: rgba(220,38,38,0.1); color: var(--danger); border: 1px solid rgba(220,38,38,0.3); }
.status-area.success { background: rgba(22,163,74,0.1); color: var(--success); border: 1px solid rgba(22,163,74,0.3); }
.status-area.warning { background: rgba(245,158,11,0.1); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }

/* ===== VIDEO INFO ===== */
.video-info { margin-bottom: 20px; }
.video-card { display: flex; gap: 20px; background: #f8f9fc; border-radius: 12px; padding: 16px; border: 1px solid var(--card-border); }
body.dark-mode .video-card { background: #eef0f5; }
.video-thumb { flex: 0 0 200px; }
.video-thumb img { width: 100%; border-radius: 8px; }
.video-details { flex: 1; }
.video-details h3 { font-size: 16px; font-weight: 700; color: #1a1a2e; margin-bottom: 8px; line-height: 1.4; }
.video-details p { font-size: 14px; color: #4a5568; margin-bottom: 8px; }
.video-details a { color: var(--gold); font-size: 13px; font-weight: 600; }
.video-details a:hover { text-decoration: underline; }

/* ===== TRANSCRIPT ===== */
.transcript-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.transcript-header h3 { font-size: 16px; color: #1a1a2e; }
.transcript-actions { display: flex; gap: 8px; }
.transcript-content { background: #f8f9fc; border-radius: 12px; padding: 20px; border: 1px solid var(--card-border); font-size: 14px; line-height: 1.8; color: #1a1a2e; max-height: 400px; overflow-y: auto; white-space: pre-wrap; }
body.dark-mode .transcript-content { background: #eef0f5; }

/* ===== SUMMARY ===== */
.summary-options { margin-bottom: 16px; }
.summary-options h3 { font-size: 16px; color: #1a1a2e; margin-bottom: 12px; }
.summary-mode-selector { display: flex; gap: 8px; margin-bottom: 16px; }
.mode-chip { display: inline-flex; align-items: center; gap: 4px; padding: 8px 18px; border-radius: 999px; border: 2px solid var(--card-border); background: transparent; color: #4a5568; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; user-select: none; }
.mode-chip input[type="radio"] { display: none; }
.mode-chip:has(input:checked) { border-color: var(--gold); background: rgba(212,175,55,0.15); color: var(--gold); }
body.dark-mode .mode-chip:has(input:checked) { border-color: var(--gold); background: rgba(0,212,255,0.15); color: var(--gold); }
.mode-chip:hover { border-color: var(--gold); }
.summary-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.summary-header h3 { font-size: 16px; color: #1a1a2e; }
.summary-actions { display: flex; gap: 8px; }
.summary-content { background: #f8f9fc; border-radius: 12px; padding: 20px; border: 1px solid var(--card-border); font-size: 14px; line-height: 1.8; color: #1a1a2e; }
body.dark-mode .summary-content { background: #eef0f5; }
.summary-content h1, .summary-content h2, .summary-content h3 { color: #1a1a2e; margin: 16px 0 8px 0; }
.summary-content strong { color: #1a1a2e; }
.summary-content ul, .summary-content ol { padding-left: 20px; margin: 8px 0; }
.summary-content li { margin: 4px 0; }

/* ===== SAVED ===== */
.saved-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; margin-top: 24px; padding-top: 24px; border-top: 2px solid var(--card-border); }
.saved-header h3 { font-size: 16px; color: #1a1a2e; }
.saved-item { background: #f8f9fc; border-radius: 12px; padding: 16px; border: 1px solid var(--card-border); margin-bottom: 12px; }
body.dark-mode .saved-item { background: #eef0f5; }
.saved-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.saved-item-title { font-size: 14px; font-weight: 700; color: #1a1a2e; }
.saved-item-date { font-size: 12px; color: #4a5568; }
.saved-item-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ===== TOAST ===== */
.toast { position: fixed; bottom: 80px; right: 24px; background: var(--navy-soft); color: #FFF; padding: 12px 24px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 9999; opacity: 0; transform: translateY(20px); transition: all 0.3s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); }

/* ===== INSTRUCTIONS ===== */
.instructions-card { background: #f0f7ff; border-radius: 12px; padding: 20px; border: 1px solid rgba(30,74,122,0.2); margin-bottom: 20px; }
body.dark-mode .instructions-card { background: #e8f4f8; }
.instructions-card h3 { font-size: 16px; color: #1a1a2e; margin-bottom: 12px; }
.instructions-list { padding-left: 20px; margin: 0; }
.instructions-list li { font-size: 14px; color: #4a5568; margin-bottom: 8px; line-height: 1.6; }
.instructions-list li strong { color: #1a1a2e; }

/* ===== AI CHAT ===== */
.chat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.chat-header h3 { font-size: 16px; color: #1a1a2e; margin: 0; }
.chat-messages {
  max-height: 400px; overflow-y: auto; padding: 16px;
  background: #f8f9fc; border-radius: 12px; border: 1px solid var(--card-border);
  margin-bottom: 12px; display: flex; flex-direction: column; gap: 12px;
}
.chat-message { display: flex; max-width: 85%; }
.chat-message.user { align-self: flex-end; }
.chat-message.ai { align-self: flex-start; }
.chat-bubble {
  padding: 10px 16px; border-radius: 16px; font-size: 14px; line-height: 1.6;
  word-wrap: break-word; overflow-wrap: break-word;
}
.chat-message.user .chat-bubble {
  background: #0078FF; color: #fff; border-bottom-right-radius: 4px;
}
.chat-message.ai .chat-bubble {
  background: #fff; color: #1a1a2e; border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}
.chat-bubble p { margin: 0 0 8px 0; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-bubble strong { font-weight: 700; }
.chat-bubble code { background: rgba(0,0,0,0.06); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.chat-bubble ul, .chat-bubble ol { margin: 6px 0; padding-left: 20px; }
.chat-bubble li { margin-bottom: 4px; }
.chat-input-area { display: flex; gap: 8px; }
.chat-input {
  flex: 1; padding: 10px 16px; border-radius: 24px; border: 1px solid #e5e7eb;
  font-size: 14px; font-family: inherit; outline: none; transition: border-color 0.2s;
}
.chat-input:focus { border-color: #0078FF; box-shadow: 0 0 0 3px rgba(0,120,255,0.1); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.typing-dots span {
  animation: blink 1.4s infinite both; font-size: 20px; font-weight: 700; color: #999;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%,80%,100%{opacity:0} 40%{opacity:1} }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .main-nav { width: 100%; display: flex; justify-content: flex-start; flex-wrap: wrap; }
  .main-nav a { margin: 4px 16px 0 0; }
  .hero h1 { font-size: 24px; }
  .input-row { flex-direction: column; }
  .video-card { flex-direction: column; }
  .video-thumb { flex: none; }
  .transcript-header { flex-direction: column; gap: 8px; align-items: flex-start; }
  .summary-header { flex-direction: column; gap: 8px; align-items: flex-start; }
  .summary-mode-selector { flex-wrap: wrap; }
  .hamburger-menu { top: 15px; left: 15px; }
  .sidebar-menu { width: 85%; max-width: 300px; }
  .lang-switcher { top: auto; bottom: 80px; right: 20px; }
}