/* UAEBusiness.ae — dark theme layer (public site + admin).
   Activated by <html data-theme="dark">. Loaded after the light theme files,
   so it only overrides tokens and surfaces; brand accents are preserved. */

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #E8EEF8;
  --navy: #0A1A33;
  --paper: #0A1322;
  --white: #FFFFFF;
  --sand: #0E1A2D;
  --line: #1F2D44;
  --line-2: #2A3B58;
  --muted: #9AA8BF;
  --muted-2: #74839C;
  --gold-soft: rgba(61,220,168,.12);
  --accent-ink: #5CE8BE;
  --green: #5CE8BE;
  --red: #FF8A7A;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 12px 32px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 30px 70px -24px rgba(0,0,0,.7);
}

html[data-theme="dark"] body { background: var(--paper); color: var(--ink); }
html[data-theme="dark"] ::selection { background: rgba(61,220,168,.3); color: #fff; }

/* Public surfaces */
html[data-theme="dark"] .site-header { background: rgba(10,19,34,.86); border-bottom-color: var(--line); }
html[data-theme="dark"] .site-header.is-scrolled { box-shadow: 0 8px 30px -18px rgba(0,0,0,.8); }
html[data-theme="dark"] .nav__link { color: #C9D4E6; }
html[data-theme="dark"] .nav__link:hover { background: #142238; color: #fff; }
html[data-theme="dark"] .nav__link.is-active { background: rgba(61,220,168,.14); color: #7BEAC6; }
html[data-theme="dark"] .mobile-nav { background: var(--paper); }
html[data-theme="dark"] .section--sand { background: #0C1729; }
html[data-theme="dark"] .stat-strip__grid,
html[data-theme="dark"] .cat-card,
html[data-theme="dark"] .biz-card,
html[data-theme="dark"] .listing-card,
html[data-theme="dark"] .emirate-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .kpi,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .contact-panel,
html[data-theme="dark"] .listing-section,
html[data-theme="dark"] .detail-table,
html[data-theme="dark"] .faq details,
html[data-theme="dark"] .toast-box {
  background: #0F1B2E; border-color: var(--line); color: var(--ink);
}
html[data-theme="dark"] .cat-card:hover { background: #132339; color: var(--ink); border-color: rgba(61,220,168,.4); }
html[data-theme="dark"] .cat-card__icon { background: rgba(61,220,168,.12); color: #5CE8BE; }
html[data-theme="dark"] .link-arrow { background: #0F1B2E; color: var(--ink); border-color: var(--line-2); }
html[data-theme="dark"] .btn--ghost { background: #0F1B2E; color: var(--ink); border-color: var(--line-2); }
html[data-theme="dark"] .btn--ghost:hover { background: #162740; color: #fff; }
html[data-theme="dark"] .btn--ink { background: #E8EEF8; border-color: #E8EEF8; color: #0A1322; }
html[data-theme="dark"] .btn--ink:hover { background: #fff; border-color: #fff; color: #0A1322; }
html[data-theme="dark"] .editorial p, html[data-theme="dark"] .prose p, html[data-theme="dark"] .editorial ul li { color: #B6C2D6; }
html[data-theme="dark"] .editorial a, html[data-theme="dark"] .detail-table a { color: #5CE8BE; }
html[data-theme="dark"] .section-lede { color: var(--muted); }
html[data-theme="dark"] .site-footer { background: #050C18; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea,
html[data-theme="dark"] .search__field {
  background: #0C1729; color: var(--ink); border-color: var(--line-2);
}
html[data-theme="dark"] .search__field { background: #0F1B2E; }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #66758E; }
html[data-theme="dark"] .eyebrow { background: rgba(61,220,168,.1); border-color: rgba(61,220,168,.22); }
html[data-theme="dark"] .flash--success, html[data-theme="dark"] .flash { background: rgba(61,220,168,.08); border-color: rgba(61,220,168,.25); color: #A7F3D7; }
html[data-theme="dark"] .flash--error { background: rgba(255,138,122,.08); border-color: rgba(255,138,122,.3); color: #FFB3A8; }

/* Admin surfaces */
html[data-theme="dark"] .admin-shell .sidebar { background: linear-gradient(180deg,#050C18 0%,#071224 100%); }
html[data-theme="dark"] .main { background: var(--sand); }
html[data-theme="dark"] .topbar { background: #0C1729; border-bottom-color: var(--line); }
html[data-theme="dark"] .topbar h1, html[data-theme="dark"] .topbar .user { color: var(--ink); }
html[data-theme="dark"] .topbar .user { color: var(--muted); }
html[data-theme="dark"] .topbar .user button { color: #5CE8BE; }
html[data-theme="dark"] .stat-card, html[data-theme="dark"] .panel, html[data-theme="dark"] .form-card,
html[data-theme="dark"] .chart-card, html[data-theme="dark"] .kpi, html[data-theme="dark"] .panel__head,
html[data-theme="dark"] .subbar, html[data-theme="dark"] .login-card {
  background: #0F1B2E; border-color: var(--line); color: var(--ink);
}
html[data-theme="dark"] .login-wrap { background: #050C18; }
html[data-theme="dark"] th { background: #0C1729; color: var(--muted); }
html[data-theme="dark"] th, html[data-theme="dark"] td { border-bottom-color: var(--line); }
html[data-theme="dark"] tr:hover td { background: rgba(255,255,255,.02); }
html[data-theme="dark"] .badge { background: #13223A; border-color: var(--line-2); color: #B6C2D6; }
html[data-theme="dark"] .badge--green { background: rgba(92,232,190,.12); border-color: rgba(92,232,190,.3); color: #7BEAC6; }
html[data-theme="dark"] .badge--gold { background: rgba(211,178,118,.14); border-color: rgba(211,178,118,.3); color: #E8CFA0; }
html[data-theme="dark"] .badge--red { background: rgba(255,138,122,.12); border-color: rgba(255,138,122,.3); color: #FFB3A8; }
html[data-theme="dark"] .btn--line { background: #0F1B2E; border-color: var(--line-2); color: var(--ink); }
html[data-theme="dark"] .btn--line:hover { border-color: #5CE8BE; }
html[data-theme="dark"] .btn--danger { background: #0F1B2E; border-color: rgba(255,138,122,.35); color: #FFB3A8; }
html[data-theme="dark"] .saved-view, html[data-theme="dark"] .tag, html[data-theme="dark"] .thumb { background: #13223A; border-color: var(--line-2); color: var(--muted); }
html[data-theme="dark"] .pagination .page { background: #0F1B2E; border-color: var(--line-2); color: var(--ink); }
html[data-theme="dark"] .pagination .page.is-active { background: #5CE8BE; border-color: #5CE8BE; color: #06121F; }
html[data-theme="dark"] .hbar__track { background: #13223A; }
html[data-theme="dark"] .hbar__fill, html[data-theme="dark"] .bar { background: #3DDCA8; }
html[data-theme="dark"] .bulkbar { background: #13223A; border-bottom: 1px solid var(--line-2); }
html[data-theme="dark"] .message-box { background: #0C1729; border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .mapbox { background: #0C1729; border-color: var(--line); }

/* Theme toggle button (shared) */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line-2);
  background: transparent; color: inherit; cursor: pointer; padding: 0;
}
.theme-toggle:hover { border-color: #3DDCA8; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Logo: swap to the white wordmark on dark surfaces. */
html[data-theme="dark"] .site-header .brand__logo { content: url("/assets/img/brand/uaebusiness-logo-white.png?v=3"); }

/* Breadcrumb strip and form labels (were white / low-contrast in dark mode). */
html[data-theme="dark"] .breadcrumbs { background: #0A1322; border-bottom-color: var(--line); }
html[data-theme="dark"] .breadcrumbs a { color: #B6C2D6; }
html[data-theme="dark"] .breadcrumbs span[aria-current] { color: var(--ink); }
html[data-theme="dark"] .field label,
html[data-theme="dark"] .form-field label,
html[data-theme="dark"] label { color: #B6C2D6; }

/* ---------------------------------------------------------------
   Dark mode for the older page templates (directory, sector/emirate
   indexes, about, advertise, contact, legal, blog, add-listing).
   These used hard-coded white/light surfaces, so text turned light
   while the box behind it stayed white.
   --------------------------------------------------------------- */
html[data-theme="dark"] .page-hero {
  background: radial-gradient(700px 300px at 90% 0%, rgba(47,107,255,.16), transparent 65%),
              radial-gradient(600px 300px at 0% 100%, rgba(52,210,123,.12), transparent 65%), #0B1526;
  border-bottom-color: var(--line);
}
html[data-theme="dark"] .page-hero__title { color: #F4F7FC; }
html[data-theme="dark"] .page-hero__lede { color: #B4C0D3; }
html[data-theme="dark"] .page-hero__map { color: #5CE8BE; opacity: .08; }
html[data-theme="dark"] .page-hero .eyebrow { background: rgba(52,210,123,.12); border-color: rgba(52,210,123,.3); color: #5CE8BE; }
html[data-theme="dark"] .page-hero__meta span { background: #0F1B2E; border-color: var(--line-2); color: #C9D4E6; }
html[data-theme="dark"] .breadcrumbs { background: #0B1526; border-color: var(--line); }

/* Directory filter bar */
html[data-theme="dark"] .directory-toolbar { background: rgba(10,19,34,.92); border-color: var(--line); }
html[data-theme="dark"] .toolbar__search input,
html[data-theme="dark"] .toolbar__search input:focus,
html[data-theme="dark"] .select-wrap select { background: #0F1B2E; color: var(--ink); border-color: var(--line-2); }
html[data-theme="dark"] .toolbar__search input::placeholder { color: #74839C; }
html[data-theme="dark"] .chip { background: #0F1B2E; color: #C9D4E6; border-color: var(--line-2); }
html[data-theme="dark"] .chip.is-active, html[data-theme="dark"] .chip:hover { background: rgba(52,210,123,.14); color: #7BEAC6; border-color: rgba(52,210,123,.4); }
html[data-theme="dark"] .results-count, html[data-theme="dark"] .results-bar { color: #B4C0D3; }
html[data-theme="dark"] .biz-card--featured { background: #102038; }

/* Generic white cards from the older templates */
html[data-theme="dark"] .featured-post,
html[data-theme="dark"] .post-card,
html[data-theme="dark"] .panel-card:not(.panel-card--dark),
html[data-theme="dark"] .about-stats__grid,
html[data-theme="dark"] .about-process > div,
html[data-theme="dark"] .home-post,
html[data-theme="dark"] .onboarding-steps li,
html[data-theme="dark"] .onboarding-card,
html[data-theme="dark"] .mode-card,
html[data-theme="dark"] .preview-card,
html[data-theme="dark"] .recent-tab,
html[data-theme="dark"] .blog-search .search__field,
html[data-theme="dark"] .onboarding-search__input,
html[data-theme="dark"] .listing-map__bar,
html[data-theme="dark"] .stat-strip__grid,
html[data-theme="dark"] .mobile-nav {
  background: #0F1B2E; border-color: var(--line); color: var(--ink);
}
html[data-theme="dark"] .mode-card:hover { background: #132339; border-color: rgba(52,210,123,.4); }
html[data-theme="dark"] .mode-card > span,
html[data-theme="dark"] .onboarding-steps li span { background: #18294A; color: #7BEAC6; }
html[data-theme="dark"] .onboarding-steps li.is-active { color: #F4F7FC; border-color: #34D27B; }
html[data-theme="dark"] .onboarding-steps li.is-active span,
html[data-theme="dark"] .onboarding-steps li.is-complete span { background: #34D27B; color: #06210F; }
html[data-theme="dark"] .onboarding-search__input input { background: transparent; color: var(--ink); }
html[data-theme="dark"] .post-card__cover:not(.has-image) { background: linear-gradient(145deg,#0E5F4A 0%,#0A3E4A 55%,#081426 100%); }
html[data-theme="dark"] .post-card__cover span { background: rgba(10,19,34,.82); color: #7BEAC6; }
html[data-theme="dark"] .post-meta,
html[data-theme="dark"] .sidebar-title,
html[data-theme="dark"] .sidebar-copy,
html[data-theme="dark"] .preview-card__footer,
html[data-theme="dark"] .onboarding-help { color: #9AA8BF; }

/* Forms */
html[data-theme="dark"] .form-field input,
html[data-theme="dark"] .form-field select,
html[data-theme="dark"] .form-field textarea,
html[data-theme="dark"] .form-field input:focus,
html[data-theme="dark"] .form-field select:focus,
html[data-theme="dark"] .form-field textarea:focus { background: #0F1B2E; color: var(--ink); border-color: var(--line-2); }
html[data-theme="dark"] .form-field input::placeholder,
html[data-theme="dark"] .form-field textarea::placeholder { color: #74839C; }

/* Article body (blog posts) */
html[data-theme="dark"] .article-body { color: #C9D4E6; }
html[data-theme="dark"] .article-body .article-lede { color: #DCE4F0; }
html[data-theme="dark"] .article-body strong,
html[data-theme="dark"] .article-body h2,
html[data-theme="dark"] .article-body h3,
html[data-theme="dark"] .article-body h4 { color: #F4F7FC; }
html[data-theme="dark"] .article-body li,
html[data-theme="dark"] .article-body td,
html[data-theme="dark"] .article-body em { color: #C9D4E6; }
html[data-theme="dark"] .article-body th { color: #F4F7FC; background: #132339; }
html[data-theme="dark"] .article-body td, html[data-theme="dark"] .article-body th { border-color: var(--line); }
html[data-theme="dark"] .article-body a { color: #5CE8BE; border-bottom-color: rgba(92,232,190,.35); }
html[data-theme="dark"] .article-body blockquote { color: #DCE4F0; background: rgba(52,210,123,.08); }
html[data-theme="dark"] .article-body .takeaways,
html[data-theme="dark"] .article-body .article-box { background: rgba(52,210,123,.07); border-color: rgba(52,210,123,.22); }
html[data-theme="dark"] .article-body .article-quote,
html[data-theme="dark"] .article-body .article-promo,
html[data-theme="dark"] .article-body .infographic,
html[data-theme="dark"] .article-body .anchor-nav a { background: #0F1B2E; border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .article-body .anchor-nav a { color: #C9D4E6; }
html[data-theme="dark"] .article-body .article-promo span,
html[data-theme="dark"] .article-body .infographic > p,
html[data-theme="dark"] .article-body .infographic b { color: #9AA8BF; }
html[data-theme="dark"] .article-body .stat-block { background: #132339; border: 1px solid var(--line); }
html[data-theme="dark"] .article-body .stat-block strong { color: #34D27B; }
html[data-theme="dark"] .article-body .stat-block span { color: #B4C0D3; }
html[data-theme="dark"] .article-body [style*="color:#"],
html[data-theme="dark"] .article-body [style*="color: #"] { color: inherit !important; }

/* Misc */
html[data-theme="dark"] .listing-head__mark.has-logo { background: #fff; }
html[data-theme="dark"] .hero-card__link:hover { background: #132339; }
html[data-theme="dark"] .editorial p, html[data-theme="dark"] .prose p, html[data-theme="dark"] .editorial ul li,
html[data-theme="dark"] .about-intro__copy p { color: #C9D4E6; }
html[data-theme="dark"] .search__select select,
html[data-theme="dark"] .form-field label,
html[data-theme="dark"] .public-contact label,
html[data-theme="dark"] .check-grid label,
html[data-theme="dark"] .submission-checks label,
html[data-theme="dark"] .preview-contact strong { color: #DCE4F0; }
html[data-theme="dark"] .sidebar-link { color: #C9D4E6; border-color: var(--line); }
html[data-theme="dark"] .sidebar-link:hover { color: #fff; }
html[data-theme="dark"] .sidebar-link.is-active { color: #5CE8BE; }
html[data-theme="dark"] .preview-description { color: #9AA8BF; }
