/* ============================================================
   Freelanzia — styles.css
   Blue × Indigo theme  |  Light + Dark mode
   ============================================================ */

/* ── Dark mode (default) ── */
:root,
[data-theme="dark"] {
  --bg:              #0e1117;
  --bg-2:            #131720;
  --bg-3:            #181e28;
  --surface:         #1c2333;
  --surface-2:       #222a40;

  --blue:            #60b4ff;
  --blue-h:          #3b9eff;
  --blue-dim:        rgba(96, 180, 255, 0.13);
  --blue-border:     rgba(96, 180, 255, 0.28);

  --indigo:          #a5b4fc;
  --indigo-h:        #818cf8;
  --indigo-dim:      rgba(165, 180, 252, 0.12);
  --indigo-border:   rgba(165, 180, 252, 0.28);

  --gold:            #fcd34d;
  --gold-light:      #fde68a;
  --gold-dim:        rgba(252, 211, 77, 0.13);
  --gold-border:     rgba(252, 211, 77, 0.28);

  --emerald:         #34d399;
  --emerald-dim:     rgba(52, 211, 153, 0.12);
  --emerald-border:  rgba(52, 211, 153, 0.25);

  --text:            #eaf0fb;
  --text-2:          #8b96aa;
  --text-3:          #44526a;

  --logo-color:      #ffffff;   /* nav wordmark: white on dark */

  --border:          rgba(255, 255, 255, 0.07);
  --border-2:        rgba(255, 255, 255, 0.14);

  --glass-bg:        rgba(28, 35, 51, 0.88);
  --glass-blur:      blur(18px);

  --shadow-sm:       0 2px 14px rgba(0,0,0,0.35);
  --shadow-md:       0 6px 28px rgba(0,0,0,0.45);
  --shadow-blue:     0 4px 24px rgba(96,180,255,0.18);
  --shadow-indigo:   0 4px 24px rgba(165,180,252,0.15);

  --nav-bg:          rgba(14,17,23,0.94);

  /* Aliases used by inline styles (notification dropdown, toasts, filters).
     These were never defined, so the dark fallbacks applied in BOTH themes —
     causing dark-on-dark text in light mode. Keep in sync with the theme. */
  --card-bg:         var(--surface);
  --border-color:    var(--border-2);
  --text-1:          var(--text);

  color-scheme: dark;
}

/* ── Light mode ── */
[data-theme="light"] {
  --bg:              #f0f4ff;
  --bg-2:            #e8eef8;
  --bg-3:            #dde5f4;
  --surface:         #ffffff;
  --surface-2:       #f5f8ff;

  --blue:            #2563eb;
  --blue-h:          #1d4ed8;
  --blue-dim:        rgba(37, 99, 235, 0.09);
  --blue-border:     rgba(37, 99, 235, 0.22);

  --indigo:          #4f46e5;
  --indigo-h:        #4338ca;
  --indigo-dim:      rgba(79, 70, 229, 0.09);
  --indigo-border:   rgba(79, 70, 229, 0.22);

  --gold:            #d97706;
  --gold-light:      #f59e0b;
  --gold-dim:        rgba(217, 119, 6, 0.09);
  --gold-border:     rgba(217, 119, 6, 0.22);

  --emerald:         #059669;
  --emerald-dim:     rgba(5, 150, 105, 0.09);
  --emerald-border:  rgba(5, 150, 105, 0.22);

  --text:            #0f172a;
  --text-2:          #475569;
  --text-3:          #94a3b8;

  --logo-color:      #1a2b4a;   /* nav wordmark: deep navy on light */

  --border:          rgba(0, 0, 0, 0.07);
  --border-2:        rgba(0, 0, 0, 0.13);

  --glass-bg:        rgba(255, 255, 255, 0.88);
  --glass-blur:      blur(18px);

  --shadow-sm:       0 2px 14px rgba(0,0,0,0.08);
  --shadow-md:       0 6px 28px rgba(0,0,0,0.12);
  --shadow-blue:     0 4px 24px rgba(37,99,235,0.14);
  --shadow-indigo:   0 4px 24px rgba(79,70,229,0.12);

  --nav-bg:          rgba(240,244,255,0.95);

  /* Same aliases, light values (see dark-theme note) */
  --card-bg:         var(--surface);
  --border-color:    var(--border-2);
  --text-1:          var(--text);

  color-scheme: light;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Never allow horizontal scroll on mobile (stray wide element safety net).
   MUST be `clip`, not `hidden`: `overflow-x: hidden` forces overflow-y to
   compute to `auto`, turning the root into a scroll container — which
   silently disables position:sticky on the nav (and the category bar it
   carries). `hidden` is kept first only as a fallback for old browsers.
   scroll-padding-top keeps anchor jumps (#buyerOrdersList etc.) from
   landing hidden underneath the sticky header. */
html, body { max-width: 100%; overflow-x: hidden; overflow-x: clip; }
html { scroll-padding-top: 104px; }

body, .nav, .glass, .home-hero, footer, .home-hero-card, .cat-card-bottom, .home-main { transition: background 0.3s ease, color 0.2s ease; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: var(--blue); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--indigo); }
img { display: block; max-width: 100%; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 999px; }

/* ── Layout ── */
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* ── Glass ── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

/* ── Nav ── */
.nav {
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 66px;
  display: flex;
  align-items: center;
  transition: background 0.3s ease, box-shadow 0.25s ease;
}

/* Scrolled state — class applied by brand-logo.js. A subtle shadow under the
   pinned nav (and the category bar it carries on home) so it separates
   cleanly from the content scrolling beneath. Theme-aware; direction-agnostic
   so it works unchanged in RTL. */
.nav.fz-nav-stuck {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.30);
}

[data-theme="light"] .nav.fz-nav-stuck {
  box-shadow: 0 6px 18px rgba(30, 60, 120, 0.12);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Brand wordmark — the "lancio." SVG rendered as a theme-coloured mask.
   Sized in em so the existing font-size hooks (default 1.5rem here, the mobile
   menu's inline 1.2rem) still control its scale. The text inside stays in the
   DOM (transparent) as the accessible name. */
.logo,
.verify-logo {
  display: inline-block;
  font-size: 1.5rem;
  height: 1.15em;
  width: 4.8em;                 /* wordmark ink aspect ~4.17:1 */
  background-color: var(--logo-color, #1a2b4a);
  -webkit-mask: url("assets/brand/lancio-wordmark-mask.svg") left center / contain no-repeat;
          mask: url("assets/brand/lancio-wordmark-mask.svg") left center / contain no-repeat;
  color: transparent;           /* hide the fallback text glyphs */
  overflow: hidden;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1;
}
[dir="rtl"] .logo,
[dir="rtl"] .verify-logo {
  -webkit-mask-position: right center;
          mask-position: right center;
}
/* The dot is part of the wordmark art now. */
.logo-dot { display: none; }

.nav-link {
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover { color: var(--text); background: var(--surface); }

nav ul { list-style: none; display: flex; gap: 4px; }
nav ul li a {
  color: var(--text-2);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
nav ul li a:hover { color: var(--text); background: var(--surface); }

/* ── Theme toggle button ── */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text-2);
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  flex: 0 0 auto;
}

.theme-toggle:hover {
  background: var(--blue-dim);
  border-color: var(--blue-border);
  color: var(--blue);
}

/* ── Utility ── */
.muted    { color: var(--text-2); font-size: 0.88rem; }
.small    { font-size: 0.8rem; }
.stack    { display: flex; flex-direction: column; gap: 12px; }
.dot      { color: var(--text-3); margin: 0 2px; }
.star     { color: var(--gold); }
.starline { color: var(--gold); letter-spacing: 2px; }

.accent {
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Button ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--blue-h), var(--indigo-h));
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 13px 26px;
  font-size: 0.97rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  width: 100%;
  text-align: center;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 18px rgba(96,180,255,0.28);
}

.btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(96,180,255,0.4);
}

.btn:active { transform: scale(0.98); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text);
  box-shadow: none;
}

.btn-ghost:hover { background: var(--surface); box-shadow: none; }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-blue   { background: var(--blue-dim);   color: var(--blue);   border: 1px solid var(--blue-border); }
.badge-indigo { background: var(--indigo-dim); color: var(--indigo); border: 1px solid var(--indigo-border); }

/* ── Footer ── */
footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  color: var(--text-3);
  padding: 28px 24px;
  text-align: center;
  font-size: 0.85rem;
  margin-top: 60px;
  transition: background 0.3s ease;
}

/* ─────────────────────────────────────────────
   B. Staggered gig-card entrance
   C. Hover lift (global — individual page CSS
      may override for its own .gig-card block)
   ───────────────────────────────────────────── */
@keyframes card-enter {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.gig-card--entering {
  animation: card-enter 450ms ease-out forwards;
  opacity: 0;
}

.gig-card {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.gig-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.14);
  border-color: var(--blue-border);
}

@media (prefers-reduced-motion: reduce) {
  .gig-card--entering            { animation: none; opacity: 1; }
  .gig-card                      { transition: border-color 180ms ease; }
  .gig-card:hover                { transform: none; box-shadow: none; }
}

/* ════════════════════════════════════════════════════════════
   FZ-DOCK  —  floating vertical navigation rail
   ════════════════════════════════════════════════════════════ */

.fz-dock {
  position: fixed;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: var(--surface, #1c2333);
  border-radius: 22px;
  box-shadow: 0 4px 18px rgba(30, 60, 120, .10);
  border: 1px solid var(--border);
}

[data-theme="light"] .fz-dock {
  background: #ffffff;
  box-shadow: 0 4px 18px rgba(30, 60, 120, .13);
}

/* Item (link or button) */
.fz-dock-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #8a93a5;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 180ms ease, color 180ms ease;
  outline: none;
}

.fz-dock-item svg { display: block; pointer-events: none; }

.fz-dock-item:hover,
.fz-dock-item:focus-visible {
  background: #eef2fd;
  color: #3763e6;
}

[data-theme="dark"] .fz-dock-item:hover,
[data-theme="dark"] .fz-dock-item:focus-visible {
  background: rgba(55, 99, 230, .16);
  color: #60b4ff;
}

.fz-dock-item:focus-visible {
  outline: 2px solid #3763e6;
  outline-offset: 2px;
}

[data-theme="dark"] .fz-dock-item:focus-visible { outline-color: #60b4ff; }

.fz-dock-item.active {
  background: #3763e6;
  color: #fff;
}

/* Tooltip sliding right */
.fz-dock-tip {
  pointer-events: none;
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  white-space: nowrap;
  background: #1a2035;
  color: #fff;
  font-size: .74rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 7px;
  opacity: 0;
  transition: opacity 150ms ease, transform 150ms ease;
  z-index: 1;
}

.fz-dock-tip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: #1a2035;
}

.fz-dock-item:hover .fz-dock-tip,
.fz-dock-item:focus-visible .fz-dock-tip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Bell unread dot */
.fz-dock-unread {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid var(--surface, #1c2333);
  pointer-events: none;
}

[data-theme="light"] .fz-dock-unread { border-color: #ffffff; }

/* Divider */
.fz-dock-divider {
  width: 30px;
  height: 1px;
  background: var(--border);
  margin: 4px 0;
  flex-shrink: 0;
}

/* Avatar circle */
.fz-dock-avatar-inner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #7c3aed;
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: .02em;
  pointer-events: none;
  background-size: cover;
  background-position: center;
}

.fz-dock-avatar-inner--client { background: #3763e6; }

/* Push dash-layout right to make room */
.fz-dock-offset { margin-left: 86px; }

/* ── Mobile: collapse to bottom bar ≤768px ── */
@media (max-width: 768px) {
  .fz-dock {
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    transform: none;
    flex-direction: row;
    justify-content: space-around;
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--border);
    padding: 8px 12px;
    gap: 0;
  }
  .fz-dock-mobile-hide { display: none !important; }
  .fz-dock-tip         { display: none !important; }
  .fz-dock-offset      { margin-left: 0; padding-bottom: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .fz-dock-item { transition: none; }
  .fz-dock-tip  { transition: none; }
}

/* ── Notification bell pulse (global — works on every page) ── */
@keyframes fz-bell-shake {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(-15deg); }
  30% { transform: rotate(15deg); }
  45% { transform: rotate(-10deg); }
  60% { transform: rotate(10deg); }
  75% { transform: rotate(-6deg); }
  90% { transform: rotate(6deg); }
}
#notifBell.bell-pulse {
  animation: fz-bell-shake 0.6s ease;
  filter: drop-shadow(0 0 8px rgba(96, 180, 255, 0.7));
}

/* ── Universal reduced-motion guard — honours the OS setting for EVERY
   animation/transition across all pages, on top of the per-feature rules. ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ════════════════════════════════════════════════════════════
   RTL FOUNDATION — active when i18n.js sets <html dir="rtl">.
   Flex/grid layouts flip on their own; only physically-positioned
   pieces need mirroring here.
   ════════════════════════════════════════════════════════════ */

/* Dock rail moves to the right edge */
[dir="rtl"] .fz-dock {
  left: auto;
  right: 12px;
}

/* Tooltips slide out to the LEFT of the dock */
[dir="rtl"] .fz-dock-tip {
  left: auto;
  right: calc(100% + 12px);
  transform: translateY(-50%) translateX(6px);
}

[dir="rtl"] .fz-dock-tip::before {
  right: auto;
  left: 100%;
  border-right-color: transparent;
  border-left-color: #1a2035;
}

[dir="rtl"] .fz-dock-item:hover .fz-dock-tip,
[dir="rtl"] .fz-dock-item:focus-visible .fz-dock-tip {
  transform: translateY(-50%) translateX(0);
}

[dir="rtl"] .fz-dock-unread {
  right: auto;
  left: 8px;
}

/* Content offset swaps sides with the dock */
[dir="rtl"] .fz-dock-offset {
  margin-left: 0;
  margin-right: 86px;
}

/* Directional glyphs (back arrows ← , chevrons…): add .fz-dir-flip to any
   icon that must mirror in RTL. */
[dir="rtl"] .fz-dir-flip {
  display: inline-block;
  transform: scaleX(-1);
}

/* ── Language dropdown (built by i18n.js under any switcher trigger) ── */
.fz-lang-menu {
  position: fixed;
  z-index: 10000;
  min-width: 150px;
  background: var(--surface, #1c2333);
  border: 1px solid var(--border, #2a3350);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, .35);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

[data-theme="light"] .fz-lang-menu {
  background: #ffffff;
  box-shadow: 0 10px 32px rgba(30, 60, 120, .18);
}

.fz-lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text, #e7ecf5);
  font-size: .88rem;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
}

.fz-lang-item:hover,
.fz-lang-item:focus-visible {
  background: rgba(55, 99, 230, .14);
}

.fz-lang-item.active {
  background: #3763e6;
  color: #fff;
}

.fz-lang-item-code {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  border: 1px solid currentColor;
  border-radius: 5px;
  padding: 1px 5px;
  opacity: .75;
}

/* Inline nav language button (public pages' simple headers) */
.fz-lang-nav {
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border-2, #2a3350);
  background: none;
  color: var(--text-2, #8b96aa);
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.fz-lang-nav:hover {
  color: var(--blue, #60b4ff);
  border-color: var(--blue-border, #3763e6);
}

/* The notification dropdown/badge markup is repeated on several pages with
   inline right:0 positioning — mirror it globally in RTL (hence !important). */
[dir="rtl"] #notifDropdown { right: auto !important; left: 0 !important; }
[dir="rtl"] #notifBadge   { right: auto !important; left: -6px !important; }

/* The mobile slide-in menu panel is defined per-page with the same class —
   mirror it globally: slides in from the LEFT in RTL. */
[dir="rtl"] .mobile-menu-panel {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid var(--border-color, #333);
  transform: translateX(-100%);
}
[dir="rtl"] .mobile-menu-panel.open { transform: translateX(0); }

/* Dashboard toast stack + mobile logout button (inline-styled) */
[dir="rtl"] #toastContainer { right: auto !important; left: 24px !important; }
[dir="rtl"] #mobileLogoutBtn { text-align: right !important; }

@media (max-width: 768px) {
  /* mobile bottom bar spans the full width in both directions */
  [dir="rtl"] .fz-dock { left: 0; right: 0; }
  [dir="rtl"] .fz-dock-offset { margin-right: 0; }
}