/*=============================================================
  DARK MODE  (hand-made part)
  - theme switch button in the header
  - colour variables for the dark theme
  - manual fixes. The bulk of the dark colours are generated into
    dark-mode-auto.css by tools/build-dark-mode.py
==============================================================*/

/* ---------- Theme switch button (moon <-> sun) ---------- */
.theme-toggle {
  --tt-bg: #fff6d6; --tt-border: #f0c85a; --tt-ico: #d99a00;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  background: var(--tt-bg) !important;
  border: 1.5px solid var(--tt-border) !important;
  color: var(--tt-ico) !important;
  box-shadow: 0 2px 10px rgba(240, 200, 90, .35);
  transition: transform .25s ease, box-shadow .25s ease, background-color .3s ease, border-color .3s ease;
}
.theme-toggle:hover,
.main-header.header-glass .header-actions .theme-toggle:hover {
  background: var(--tt-bg) !important;
  border-color: var(--tt-border) !important;
  color: var(--tt-ico) !important;
  transform: translateY(-2px) rotate(-8deg);
  box-shadow: 0 8px 20px rgba(240, 200, 90, .5);
}
.theme-toggle:focus-visible { outline: 3px solid rgba(240, 200, 90, .65); outline-offset: 2px; }
.theme-toggle:active { transform: scale(.92); }
.theme-toggle .theme-ico {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; line-height: 1;
  transition: transform .45s cubic-bezier(.4, 0, .2, 1), opacity .3s ease;
}
/* light page -> show moon (click = go dark) */
.theme-toggle .theme-ico-moon { opacity: 1; transform: rotate(0) scale(1); }
.theme-toggle .theme-ico-sun  { opacity: 0; transform: rotate(-90deg) scale(.4); }
/* dark page -> show sun (click = go light) */
html[data-theme="dark"] .theme-toggle { --tt-bg: #1b2745; --tt-border: #f0c85a; --tt-ico: #ffd24d; box-shadow: 0 2px 14px rgba(255, 210, 77, .22); }
html[data-theme="dark"] .theme-toggle .theme-ico-moon { opacity: 0; transform: rotate(90deg) scale(.4); }
html[data-theme="dark"] .theme-toggle .theme-ico-sun  { opacity: 1; transform: rotate(0) scale(1); }

/* sizes follow the other header buttons */
.header-actions .theme-toggle { width: 42px; height: 42px; }
.main-header.header-glass .header-theme-mobile { width: 44px; height: 44px; margin-right: 8px !important; }
@media (max-width: 575.98px) {
  .main-header.header-glass .header-theme-mobile { width: 40px; height: 40px; margin-right: 6px !important; }
  .theme-toggle .theme-ico { font-size: 16px; }
}
@media (max-width: 359.98px) {
  .main-header.header-glass .header-theme-mobile { width: 36px; height: 36px; margin-right: 4px !important; }
}
@media (min-width: 992px) and (max-width: 1199.98px) { .header-actions .theme-toggle { width: 38px; height: 38px; } }
@media (max-width: 1100px) and (min-width: 992px) { .header-actions .theme-toggle { width: 36px; height: 36px; } }

/* smooth fade only while switching */
html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after {
  transition: background-color .35s ease, color .35s ease, border-color .35s ease, fill .35s ease, box-shadow .35s ease !important;
}
@media (prefers-reduced-motion: reduce) {
  .theme-toggle, .theme-toggle .theme-ico { transition: none; }
  html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after { transition: none !important; }
}

/* ---------- Dark colour variables ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg-white: #0e1526;
  --bg-light: #121b30;
  --text-dark: #e6ebf6;
  --text-primary: #e3ebff;
  --text-muted: #9aa8c2;
  --border-color: #25314d;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .4);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, .5);
  --bs-body-bg: #0b1220;
  --bs-body-color: #e6ebf6;
  --bs-border-color: #25314d;
  --bs-secondary-color: #9aa8c2;
}
html[data-theme="dark"] body { background-color: #0b1220; color: var(--text-dark); }
html[data-theme="dark"] ::selection { background: rgba(255, 107, 0, .45); color: #fff; }
html[data-theme="dark"] img { filter: brightness(.92); }
html[data-theme="dark"] .brand-logo-img,
html[data-theme="dark"] .preloader-logo,
html[data-theme="dark"] .footer-logo img { filter: none; }
html[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }
html[data-theme="dark"] .text-dark { color: var(--text-dark) !important; }
html[data-theme="dark"] .bg-white { background-color: var(--bg-white) !important; }
html[data-theme="dark"] .bg-light { background-color: var(--bg-light) !important; }
html[data-theme="dark"] .border, html[data-theme="dark"] hr { border-color: var(--border-color) !important; }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #7585a3; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #0b1220; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2a3a5f; border-radius: 8px; }

/* ---------- Header ---------- */
html[data-theme="dark"] .main-header,
html[data-theme="dark"] .main-header.is-sticky { background-color: #0e1526 !important; border-bottom-color: #25314d; }
html[data-theme="dark"] .main-header.header-glass {
  background: rgba(11, 18, 32, .72);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
}
html[data-theme="dark"] .main-header.header-glass.is-sticky {
  background: rgba(11, 18, 32, .92) !important;
  border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
  box-shadow: 0 10px 35px rgba(0, 0, 0, .5) !important;
}
html[data-theme="dark"] .main-header.header-glass .navbar-nav .nav-link { color: #e3ebff; }
html[data-theme="dark"] .main-header.header-glass .navbar-nav .nav-link:hover,
html[data-theme="dark"] .main-header.header-glass .navbar-nav .nav-link.active { color: var(--accent); }
html[data-theme="dark"] .main-header.header-glass .header-actions .action-btn:not(.theme-toggle),
html[data-theme="dark"] .main-header.header-glass .header-search-mobile {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .12);
  color: #e3ebff;
}
html[data-theme="dark"] .main-header.header-glass .header-actions .action-btn:not(.theme-toggle):hover {
  background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important;
}
html[data-theme="dark"] .navbar-toggler { color: #e3ebff; }

/* top bar + footer keep their navy look, a touch deeper */
html[data-theme="dark"] .top-header { background-color: #08122d; }

/* ---------- Small manual fixes ---------- */
html[data-theme="dark"] .btn-light { background-color: #1a2540; border-color: #2a3a5f; color: #e6ebf6; }
html[data-theme="dark"] .btn-light:hover { background-color: var(--accent); border-color: var(--accent); color: #fff; }
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .offcanvas { background-color: #0e1526; color: #e6ebf6; }
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }

/* ============================================================
   DARK MODE - PROFESSIONAL LOGO TREATMENT (header, mobile menu, footer)
   The full-colour logo is designed for a light surface, so in dark mode it
   sits on a clean light "plate" with a soft orange glow. Fully responsive:
   the header plate follows --logo-h, the footer badge scales with the column.
   ============================================================ */

/* ---- header (desktop / tablet / phone) ---- */
html[data-theme="dark"] .main-header.header-glass .brand-logo {
  padding: 0;
  background: linear-gradient(180deg, #ffffff 0%, #eef3fb 100%);
  border: 1px solid rgba(255, 138, 31, .55);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45), 0 0 0 3px rgba(255, 107, 0, .10), 0 0 22px rgba(255, 107, 0, .22);
  overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease;
}
html[data-theme="dark"] .main-header.header-glass .brand-logo:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .5), 0 0 0 3px rgba(255, 107, 0, .18), 0 0 28px rgba(255, 107, 0, .36);
}
html[data-theme="dark"] .main-header.header-glass .brand-logo .brand-logo-img {
  height: calc(var(--logo-h) - 6px);
  padding: 3px 10px;
  background: transparent;
  filter: none;
  border-radius: 0;
}
@media (max-width: 575px) {
  html[data-theme="dark"] .main-header.header-glass .brand-logo { border-radius: 11px; }
  html[data-theme="dark"] .main-header.header-glass .brand-logo .brand-logo-img { padding: 2px 7px; height: calc(var(--logo-h) - 4px); }
}

/* ---- mobile menu (offcanvas) ---- */
html[data-theme="dark"] .offcanvas .offcanvas-header .brand-logo {
  display: inline-flex;
  background: linear-gradient(180deg, #ffffff 0%, #eef3fb 100%);
  border: 1px solid rgba(255, 138, 31, .55);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4), 0 0 18px rgba(255, 107, 0, .18);
  overflow: hidden;
}
html[data-theme="dark"] .offcanvas .offcanvas-header .brand-logo-img,
html[data-theme="dark"] .adv-offcanvas .offcanvas-header .brand-logo-img,
html[data-theme="dark"] .offcanvas-mobile.adv-offcanvas .offcanvas-header .brand-logo-img {
  background: transparent;
  filter: none;
  padding: 4px 12px;
  height: 52px;
  max-height: none;
  width: auto;
}

/* ---- footer badge ---- */
html[data-theme="dark"] .tb-footer-v3 .footer-brand-badge {
  background: linear-gradient(180deg, #ffffff 0%, #eef3fb 100%);
  border: 1px solid rgba(255, 138, 31, .6);
  border-radius: 22px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .5), 0 0 0 5px rgba(255, 107, 0, .08), 0 0 34px rgba(255, 107, 0, .22);
}
html[data-theme="dark"] .tb-footer-v3 .footer-brand-badge:hover {
  box-shadow: 0 20px 46px rgba(0, 0, 0, .55), 0 0 0 5px rgba(255, 107, 0, .16), 0 0 44px rgba(255, 107, 0, .38);
}
html[data-theme="dark"] .tb-footer-v3 .footer-brand-logo {
  background: transparent;
  padding: 14px 20px;
}
html[data-theme="dark"] .tb-footer-v3 .footer-brand-badge img.footer-logo {
  background: transparent;
  border: 0;
  filter: none;
  width: 100%;
  max-width: 240px;
  height: auto;
}
@media (max-width: 575.98px) {
  html[data-theme="dark"] .tb-footer-v3 .footer-brand-badge { width: min(100%, 260px); border-radius: 18px; }
  html[data-theme="dark"] .tb-footer-v3 .footer-brand-logo { padding: 12px 16px; }
  html[data-theme="dark"] .tb-footer-v3 .footer-brand-badge img.footer-logo { max-width: 190px; }
}

/* ---- sticky header: logo plate shrinks with the bar ---- */
html[data-theme="dark"] .main-header.header-glass.is-sticky .brand-logo { box-shadow: 0 4px 14px rgba(0, 0, 0, .45), 0 0 14px rgba(255, 107, 0, .18); }

/* ---- reviews section (dark) ---- */
html[data-theme="dark"] .tb-rv-dunes { opacity: .14; }
html[data-theme="dark"] .tb-rv-progress { background: rgba(255, 255, 255, .14); }
html[data-theme="dark"] .tb-rv-card::after { color: rgba(255, 138, 31, .09); }
html[data-theme="dark"] .tb-rv-swiper .swiper-slide-active .tb-rv-card { box-shadow: 0 24px 55px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 138, 31, .28); }
html[data-theme="dark"] .tb-rv-avatar { filter: none; }
