/* ============================================
   Box Lovable — Yellow
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

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

:root {
  --red:         #EAB308;
  --red-neon:    #FACC15;
  --red-dark:    #A16207;
  --red-deep:    #1A1500;
  --red-glow:    rgba(234, 179, 8, 0.15);
  --red-glow-md: rgba(234, 179, 8, 0.25);
  --red-glow-hi: rgba(234, 179, 8, 0.45);
  --red-border:  rgba(234, 179, 8, 0.2);
  --bg:          #0A0A05;
  --card:        rgba(20, 18, 5, 0.85);
  --surface:     rgba(30, 25, 8, 0.7);
  --border:      rgba(234, 179, 8, 0.08);
  --text:        #F2F2F2;
  --text-dim:    #8A8555;
  --text-muted:  #555530;
  --glass:       rgba(234, 179, 8, 0.03);
}

/* Light mode disabled - dark only */

body {
  width: 100%; min-height: 100vh;
  background: var(--bg);
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ─── BACKGROUND ─── */
.dl-bg {
  position: fixed; inset: 0; z-index: -1;
  background: var(--bg);
  overflow: hidden;
}

/* Ambient red glow top */
.dl-bg::before {
  content: '';
  position: absolute;
  top: -30%; left: 50%; transform: translateX(-50%);
  width: 120%; height: 50%;
  background: radial-gradient(ellipse at center, rgba(220,20,60,0.1) 0%, rgba(139,0,0,0.05) 40%, transparent 70%);
  pointer-events: none;
  animation: breathe 6s ease-in-out infinite alternate;
}

/* Ambient red glow bottom */
.dl-bg::after {
  content: '';
  position: absolute;
  bottom: -20%; left: 50%; transform: translateX(-50%);
  width: 100%; height: 40%;
  background: radial-gradient(ellipse at center, rgba(255,23,68,0.06) 0%, transparent 60%);
  pointer-events: none;
  animation: breathe 8s ease-in-out infinite alternate-reverse;
}

@keyframes breathe {
  0%   { opacity: 0.6; }
  100% { opacity: 1; }
}

/* ─── GLASS CARD ─── */
.glass-card {
  width: 100%; min-height: 100vh;
  padding: 20px 16px 16px;
  display: flex; flex-direction: column;
  background: var(--glass);
  backdrop-filter: blur(20px);
  position: relative;
}

/* Subtle scanline overlay */
.glass-card::before {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255,23,68,0.008) 2px,
    rgba(255,23,68,0.008) 4px
  );
  pointer-events: none; z-index: 999;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 2px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--red-dark); border-radius: 2px; }

/* ─── HEADER ─── */
.header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

/* Neon line under header */
.header::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--red-neon) 50%, transparent 100%);
  opacity: 0.3;
}

.logo { display: flex; align-items: center; gap: 10px; }

.logo-icon {
  width: 30px; height: 30px; border-radius: 8px;
  box-shadow: 0 0 15px rgba(220,20,60,0.35), 0 0 30px rgba(220,20,60,0.1);
}

.logo-text {
  font-size: 1.1rem; font-weight: 900;
  color: var(--red-neon);
  text-shadow: 0 0 20px rgba(255,23,68,0.5), 0 0 40px rgba(255,23,68,0.15);
  letter-spacing: 0.5px;
}

.header-right { display: flex; align-items: center; gap: 12px; }

/* ─── THEME TOGGLE ─── */
.theme-toggle {
  width: 38px; height: 20px; border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--red-border);
  position: relative; cursor: pointer;
  transition: .3s; flex-shrink: 0;
}

.theme-toggle-knob {
  position: absolute; left: 2px; top: 2px;
  width: 16px; height: 16px;
  background: var(--text-muted); border-radius: 50%;
  transition: .3s;
  display: flex; align-items: center; justify-content: center;
  font-size: .55rem;
}

[data-theme="dark"] .theme-toggle-knob {
  left: calc(100% - 18px);
  background: var(--red-neon);
  box-shadow: 0 0 8px var(--red-glow-hi);
}

/* ─── HEADER ICONS ─── */
.hdr-icon {
  color: var(--text-dim); cursor: pointer;
  transition: .2s;
  display: flex; align-items: center;
}
.hdr-icon:hover {
  color: var(--red-neon);
  filter: drop-shadow(0 0 4px rgba(255,23,68,0.5));
}

/* ─── USER CARD ─── */
.user-card {
  background: var(--card);
  border: 1px solid var(--red-border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  transition: .3s;
  backdrop-filter: blur(10px);
}

.user-card:hover {
  border-color: rgba(255,23,68,0.35);
  box-shadow: 0 0 25px rgba(255,23,68,0.08), inset 0 0 30px rgba(255,23,68,0.02);
}

/* Side accent bar */
.user-card::after {
  content: '';
  position: absolute; right: 0; top: 8px; bottom: 8px; width: 3px;
  background: var(--red-neon);
  border-radius: 3px 0 0 3px;
  box-shadow: -3px 0 12px var(--red-glow-md);
}

.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--red-deep);
  border: 1px solid var(--red-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--red-neon); flex-shrink: 0;
  box-shadow: 0 0 12px var(--red-glow);
}

.user-info { flex: 1; }
.user-name { font-size: .82rem; font-weight: 700; color: var(--text); }
.user-expiry { font-size: .68rem; color: var(--text-dim); margin-top: 2px; }

.status-badge {
  background: var(--red-deep);
  color: var(--red-neon);
  border: 1px solid var(--red-border);
  padding: 3px 10px; border-radius: 20px;
  font-size: .58rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.8px;
  text-shadow: 0 0 8px rgba(255,23,68,0.5);
}

/* ─── SYNC STATUS ─── */
.sync-status {
  font-size: .72rem; font-weight: 600;
  padding: 8px 12px; border-radius: 8px;
  margin-bottom: 16px; text-align: center;
  backdrop-filter: blur(8px);
}
.sync-ok {
  background: rgba(34,197,94,0.06);
  color: #4ade80; border: 1px solid rgba(34,197,94,0.12);
  text-shadow: 0 0 8px rgba(34,197,94,0.3);
}
.sync-waiting {
  background: rgba(250,204,21,0.06);
  color: #fbbf24; border: 1px solid rgba(250,204,21,0.12);
}

/* ─── TABS ─── */
.tabs {
  display: flex;
  background: var(--card);
  border-radius: 12px;
  padding: 4px; gap: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.tab-btn {
  flex: 1; background: transparent; border: none;
  border-radius: 9px; padding: 10px 0;
  color: var(--text-dim); font-size: .72rem; font-weight: 700;
  cursor: pointer; transition: .25s;
  text-transform: uppercase; letter-spacing: 0.08em;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  background: var(--red);
  color: #fff;
  box-shadow: 0 0 20px var(--red-glow-md), 0 2px 8px rgba(0,0,0,0.4);
  text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

/* ─── TEXTAREA ─── */
.msg-textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: .82rem; color: var(--text);
  resize: vertical; font-family: inherit;
  line-height: 1.6; min-height: 100px;
  transition: .25s;
  backdrop-filter: blur(10px);
}

.msg-textarea:focus {
  outline: none;
  border-color: rgba(255,23,68,0.35);
  box-shadow: 0 0 20px var(--red-glow), inset 0 0 20px rgba(255,23,68,0.02);
}

.msg-textarea::placeholder { color: var(--text-muted); }

/* ─── ACTION BUTTONS ─── */
.btn-action-icon {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: .25s;
  backdrop-filter: blur(10px);
}

.btn-action-icon:hover {
  border-color: var(--red-border);
  color: var(--red-neon);
  background: var(--red-glow);
  box-shadow: 0 0 15px var(--red-glow);
  transform: translateY(-1px);
}

.btn-action-icon.ql-recording {
  background: rgba(255,23,68,0.12) !important;
  border-color: var(--red-neon) !important;
  color: var(--red-neon) !important;
  box-shadow: 0 0 20px var(--red-glow-md) !important;
  animation: recGlow 1.2s infinite;
}

@keyframes recGlow {
  0%, 100% { box-shadow: 0 0 10px var(--red-glow); }
  50% { box-shadow: 0 0 25px var(--red-glow-hi); }
}

/* ─── SEND BUTTON ─── */
.btn-send {
  flex: 1; height: 48px;
  background: var(--red);
  border: 1px solid rgba(255,23,68,0.4);
  border-radius: 12px;
  color: #fff; font-weight: 800; font-size: .9rem;
  cursor: pointer; transition: .25s;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  box-shadow: 0 0 20px var(--red-glow), 0 4px 16px rgba(0,0,0,0.4);
  position: relative; overflow: hidden;
}

.btn-send::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 50%);
  pointer-events: none;
}

.btn-send:hover {
  background: #E8163F;
  transform: translateY(-2px);
  box-shadow: 0 0 35px var(--red-glow-md), 0 6px 24px rgba(0,0,0,0.5);
}

.btn-send:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }

.ql-send-blink { animation: sendNeon 1.5s infinite; }

@keyframes sendNeon {
  0%, 100% { box-shadow: 0 0 20px var(--red-glow); }
  50% { box-shadow: 0 0 40px var(--red-glow-hi), 0 0 60px var(--red-glow); }
}

/* ─── DIVIDERS ─── */
.divider {
  height: 1px; margin: 16px 0;
  background: linear-gradient(90deg, transparent, var(--red-border), transparent);
}

.section-title {
  font-size: .6rem; font-weight: 800;
  letter-spacing: 2.5px; text-transform: uppercase;
  margin-bottom: 10px;
  color: var(--red-neon); opacity: 0.7;
  text-shadow: 0 0 10px var(--red-glow);
}

/* ─── GRID BUTTONS ─── */
.btn-grid {
  height: 42px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-dim); font-weight: 600; font-size: .72rem;
  cursor: pointer; transition: .25s;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  backdrop-filter: blur(10px);
}

.btn-grid:hover {
  border-color: var(--red-border);
  color: var(--text);
  background: var(--red-glow);
  box-shadow: 0 0 15px var(--red-glow);
}

.btn-grid.shield-active {
  background: var(--red-glow) !important;
  border-color: var(--red-neon) !important;
  color: var(--red-neon) !important;
  box-shadow: 0 0 20px var(--red-glow-md) !important;
  text-shadow: 0 0 8px rgba(255,23,68,0.4);
}

.shield-dot {
  width: 5px; height: 5px;
  background: var(--text-muted);
  border-radius: 50%; transition: .2s;
}

.shield-active .shield-dot {
  background: var(--red-neon);
  box-shadow: 0 0 8px var(--red-glow-hi);
}

/* ─── RESPONSE AREA ─── */
.response-area {
  margin-top: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
  font-size: .75rem; color: var(--text-dim);
  display: none; backdrop-filter: blur(10px);
}
.response-area.visible { display: block; animation: fadeIn .3s ease; }

/* ─── ATTACHMENTS ─── */
.attach-preview-container {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px; margin-top: 10px;
  background: var(--card);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.attach-item {
  position: relative;
  width: 50px; height: 50px;
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: .2s;
  animation: fadeIn .3s ease;
}

.attach-item:hover {
  border-color: rgba(255,23,68,0.35);
  box-shadow: 0 0 12px var(--red-glow);
  transform: scale(1.08);
}

.attach-remove {
  position: absolute; top: 2px; right: 2px;
  background: var(--red); color: #fff; border: none;
  border-radius: 50%; width: 14px; height: 14px;
  font-size: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: .15s;
  box-shadow: 0 0 6px var(--red-glow-md);
}
.attach-item:hover .attach-remove { opacity: 1; }

/* ─── DROP ZONE ─── */
.drop-overlay {
  display: none; position: absolute; inset: 0;
  background: rgba(255,23,68,0.04);
  border: 2px dashed rgba(255,23,68,0.3);
  border-radius: 12px; z-index: 50;
  flex-direction: column; align-items: center; justify-content: center;
  color: var(--red-neon); font-weight: 700; font-size: .8rem;
  pointer-events: none;
  box-shadow: inset 0 0 30px var(--red-glow);
}

/* ─── ALERT ─── */
.dl-alert-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.8);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
  animation: fadeIn .2s ease;
}

.dl-alert {
  background: var(--card);
  border: 1px solid var(--red-border);
  border-radius: 16px; padding: 24px;
  width: 260px; text-align: center;
  box-shadow: 0 0 40px var(--red-glow), 0 20px 50px rgba(0,0,0,0.7);
  backdrop-filter: blur(20px);
}

.dl-alert-title { font-weight: 800; font-size: .9rem; color: var(--red-neon); margin-bottom: 8px; text-shadow: 0 0 10px var(--red-glow); }
.dl-alert-message { font-size: .78rem; color: var(--text-dim); margin-bottom: 16px; line-height: 1.5; }

.dl-alert-ok {
  background: var(--red); border: 1px solid rgba(255,23,68,0.5);
  border-radius: 8px; color: #fff;
  padding: 8px 28px; cursor: pointer;
  font-weight: 700; font-size: .8rem; transition: .2s;
  box-shadow: 0 0 15px var(--red-glow);
}
.dl-alert-ok:hover {
  box-shadow: 0 0 25px var(--red-glow-md);
  transform: translateY(-1px);
}

/* ─── HISTORY ─── */
.history-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
  transition: .2s; backdrop-filter: blur(8px);
}

.history-item:hover {
  border-color: var(--red-border);
  box-shadow: 0 0 12px var(--red-glow);
}

.history-use-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim); font-size: .62rem;
  padding: 3px 10px; border-radius: 4px;
  cursor: pointer; transition: .2s; font-weight: 600;
}
.history-use-btn:hover {
  border-color: var(--red-neon);
  color: var(--red-neon);
  box-shadow: 0 0 8px var(--red-glow);
}

/* ─── COUNTDOWN ─── */
.countdown-bar {
  height: 3px; background: var(--surface);
  border-radius: 2px; overflow: hidden;
}
.countdown-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red-dark), var(--red-neon));
  box-shadow: 0 0 8px var(--red-glow);
  transition: width 1s linear;
}
.countdown-bar-fill.urgent {
  background: #f59e0b;
  animation: urgentPulse 1s infinite;
}

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

/* ─── LICENSE GATE ─── */
.license-gate {
  text-align: center; padding: 40px 16px;
  animation: fadeIn .4s ease;
}

.license-gate-icon {
  width: 60px; height: 60px;
  background: var(--red-deep);
  border: 1px solid var(--red-border);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 28px;
  color: var(--red-neon);
  box-shadow: 0 0 25px var(--red-glow), 0 0 50px rgba(255,23,68,0.06);
}

.license-input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  text-align: center;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: .88rem; font-weight: 700;
  text-transform: uppercase; color: var(--text);
  transition: .25s;
  letter-spacing: 3px;
  backdrop-filter: blur(10px);
}

.license-input:focus {
  outline: none;
  border-color: rgba(255,23,68,0.35);
  box-shadow: 0 0 20px var(--red-glow), inset 0 0 15px rgba(255,23,68,0.03);
}

.license-input::placeholder {
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 1px;
}

/* ─── SPINNER ─── */
.dl-spin {
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--red-neon);
  border-radius: 50%;
  animation: dlSpin .7s linear infinite;
}

@keyframes dlSpin { to { transform: rotate(360deg); } }

/* ─── ANIMATIONS ─── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-open { animation: fadeIn .35s ease forwards; }

/* ─── FOOTER ─── */
.footer {
  display: flex; align-items: center; justify-content: center;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: auto;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute; top: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,23,68,0.2), transparent);
}

.footer-text {
  font-size: .58rem; font-weight: 700;
  color: var(--red-neon); opacity: 0.4;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--red-glow);
}

/* ─── UTILS ─── */
.tool-loading { opacity: 0.4; pointer-events: none; }

/* ─── SEND MODE SELECTOR ─── */
.dl-mode-selector {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 16px;
  gap: 4px;
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.dl-mode-btn {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dl-mode-btn:hover {
  color: var(--text);
  background: rgba(255, 23, 68, 0.02);
}

.dl-mode-btn.active {
  background: var(--red-deep);
  color: var(--red-neon);
  border: 1px solid var(--red-border);
  box-shadow: 0 0 12px var(--red-glow-md);
  text-shadow: 0 0 8px rgba(255, 23, 68, 0.4);
}
