/* ============================================================
   Addlivetag – Core Theme Tokens & Base Styles
   Design language: "Live-Commerce Editorial" (warm paper + coral + teal).
   ONE token set, light default, dark via [data-theme="dark"] on <html>
   (set pre-paint by js/site-theme.js). Load order:
   Bootstrap → FontAwesome → this file → site-components.css → page CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

/* --- Design tokens (LIGHT default) ------------------------- */
:root {
  --color-bg:          #f4f1ea;   /* warm paper */
  --color-bg-card:     #fffdf8;   /* surface */
  --color-surface-2:   #efeae0;
  --color-surface-3:   #e6e0d3;

  --color-accent:      #f5471f;   /* PRIMARY coral (brand) */
  --color-accent-hover:#d83a14;
  --color-accent-dim:  #fde9e2;
  --color-cta:         #f5471f;
  --color-cta-hover:   #d83a14;

  --color-teal:        #0d7a6b;   /* secondary accent (data / links) */
  --color-teal-dim:    #dbefe9;
  --color-warning:     #b4690e;   /* gold */
  --color-success:     #15803d;
  --color-danger:      #dc2626;

  --color-text:        #191713;   /* ink */
  --color-soft:        #4d4840;
  --color-muted:       #8c857a;
  --color-border:      #e2dccf;
  --color-border-strong:#d2cbbb;

  --glass-bg:          rgba(255, 253, 248, 0.96);
  --glass-blur:        blur(12px);
  --glass-border:      #e2dccf;

  --card-glow:         0 1px 2px rgba(25,23,19,.05), 0 8px 24px rgba(25,23,19,.06);
  --card-glow-hover:   0 18px 50px rgba(25,23,19,.14);
  --shadow-navbar:     0 1px 0 rgba(25,23,19,.04);

  --radius-sm:         10px;
  --radius-md:         16px;
  --radius-lg:         24px;
  --radius-pill:       999px;

  --transition-fast:   0.15s cubic-bezier(.2,.7,.2,1);
  --transition:        0.25s cubic-bezier(.2,.7,.2,1);

  --font-heading:      'Be Vietnam Pro', system-ui, sans-serif;
  --font-body:         'Be Vietnam Pro', system-ui, sans-serif;
  --font-mono:         'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --color-bg:          #121110;   /* warm near-black */
  --color-bg-card:     #1c1a17;
  --color-surface-2:   #24211c;
  --color-surface-3:   #2e2a23;

  --color-accent:      #ff6a45;
  --color-accent-hover:#ff8163;
  --color-accent-dim:  rgba(255,106,69,.16);
  --color-cta:         #ff6a45;
  --color-cta-hover:   #ff8163;

  --color-teal:        #33d6bf;
  --color-teal-dim:    rgba(51,214,191,.15);
  --color-warning:     #e9a23b;
  --color-success:     #34d399;
  --color-danger:      #f87171;

  --color-text:        #f5f1e8;
  --color-soft:        #cbc4b6;
  --color-muted:       #8f897c;
  --color-border:      rgba(255,255,255,.09);
  --color-border-strong:rgba(255,255,255,.16);

  --glass-bg:          rgba(28, 26, 23, 0.96);
  --glass-border:      rgba(255,255,255,.09);

  --card-glow:         0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.5);
  --card-glow-hover:   0 24px 60px rgba(0,0,0,.6);
  --shadow-navbar:     0 1px 0 rgba(255,255,255,.05);

  color-scheme: dark;
}

/* --- Base -------------------------------------------------- */
html { scroll-behavior: smooth; }

/* Themed base for all pages (pages with their own inline body bg still win). */
body {
  background:  var(--color-bg);
  color:       var(--color-text);
  font-family: var(--font-body);
  /* Subtle paper-grain dot texture for atmosphere (very low contrast). */
  background-image: radial-gradient(var(--color-border) .9px, transparent .9px);
  background-size: 22px 22px;
  transition: background var(--transition), color var(--transition);
}

body.page-dark {
  font-size:      15px;
  line-height:    1.65;
  display:        flex;
  flex-direction: column;
  min-height:     100dvh;
}
body.page-dark main { flex: 1; }

h1, h2, h3, h4, h5, h6,
body.page-dark h1, body.page-dark h2, body.page-dark h3,
body.page-dark h4, body.page-dark h5, body.page-dark h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.02em;
}

a { color: inherit; }
a:hover { text-decoration: none; }

/* Tabular numbers helper */
.mono, .tabnum { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Custom scrollbar */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-accent); }

/* --- Utility / Bootstrap overrides ------------------------ */
.text-muted    { color: var(--color-muted) !important; }
.text-warning  { color: var(--color-warning) !important; }
.badge-danger  { background-color: var(--color-accent) !important; color:#fff; border-radius: 6px; }
.badge-primary { background-color: var(--color-teal) !important; color:#fff; border-radius: 6px; }

/* --- Watermark -------------------------------------------- */
#watermark-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .03;
  mix-blend-mode: multiply;
  background-size: cover;
}
[data-theme="dark"] #watermark-background { mix-blend-mode: screen; opacity: .04; }

/* --- Notification bell + dropdown ------------------------- */
.notif-bell-wrap { position: relative; }

.notif-bell {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  font-size: 1.15rem;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
  line-height: 1;
}
.notif-bell:hover { color: var(--color-accent); background: var(--color-accent-dim); }

.notif-badge {
  position: absolute;
  top: -4px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  pointer-events: none;
}

.notif-dropdown {
  width: 320px;
  max-width: 94vw;
  padding: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.notif-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 8px;
  font-size: .82rem;
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}
.notif-mark-all-link {
  font-size: .75rem;
  font-weight: 500;
  color: var(--color-teal) !important;
  text-decoration: none;
}
.notif-mark-all-link:hover { text-decoration: underline; }

.notif-dropdown-list { max-height: 320px; overflow-y: auto; }

.notif-dropdown-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: .78rem;
}
.notif-dropdown-footer a { color: var(--color-teal) !important; text-decoration: none; }
.notif-dropdown-footer a:hover { text-decoration: underline; }

.notif-item, a.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-card);
  text-decoration: none !important;
  color: var(--color-text) !important;
  transition: background var(--transition-fast);
  position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--color-surface-2); }
.notif-item--read { opacity: .72; }

.notif-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-accent-dim);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  margin-top: 1px;
}

.notif-content { flex: 1; min-width: 0; }
.notif-title { display: block; font-size: .83rem; font-weight: 600; line-height: 1.3; }
.notif-body  { display: block; font-size: .76rem; color: var(--color-muted); margin-top: 2px; }
.notif-time  { display: block; font-size: .7rem; color: var(--color-muted); margin-top: 3px; }

.notif-dot {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
}

.notif-empty {
  padding: 20px 14px;
  text-align: center;
  color: var(--color-muted);
  font-size: .82rem;
}

/* Toast notifications */
#notif-toast-container {
  position: fixed;
  top: 68px;
  right: 14px;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.notif-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-md);
  box-shadow: var(--card-glow-hover);
  max-width: 300px;
  pointer-events: all;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity var(--transition), transform var(--transition);
}
.notif-toast--show { opacity: 1; transform: translateX(0); }
.notif-toast--hide { opacity: 0; transform: translateX(20px); }

.notif-toast-icon {
  flex-shrink: 0;
  color: var(--color-accent);
  font-size: .9rem;
  margin-top: 1px;
}
.notif-toast-body { flex: 1; font-size: .8rem; color: var(--color-text); line-height: 1.4; }
.notif-toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 2px;
}
.notif-toast-close:hover { color: var(--color-text); }

/* --- Back-to-top button ----------------------------------- */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: none;
  z-index: 9999;
}
