/* Dark mode: hand-made fixes on top of dark-auto.css (which is generated: see scripts/make-dark-css.js).
   Everything here only applies when the visitor has picked dark mode (html[data-theme="dark"]). */

html[data-theme="dark"] {
    color-scheme: dark; /* dark scrollbars, date pickers and form controls */
    --dm-page: #0f141a;
    --dm-surface: #161d25;
    --dm-surface-2: #1c2530;
    --dm-line: #2a3542;
    --dm-text: #e3e9ef;
    --dm-muted: #9aa7b4;
}

/* Smooth colour change when switching (only during the switch, so it never slows the page down). */
html.ce-theme-switching, html.ce-theme-switching * { transition: background-color .25s ease, color .25s ease, border-color .25s ease !important; }

html[data-theme="dark"] body,
html[data-theme="dark"] .wrapper { background-color: var(--dm-page); color: var(--dm-text); }

/* The black Chenz logo turns white, wherever it appears (header, footer, other pages). */
html[data-theme="dark"] img[src*="chenz-logo"],
html[data-theme="dark"] .ce-logo-dark-invert { filter: invert(1) brightness(1.05); }

/* Header */
html[data-theme="dark"] .header,
html[data-theme="dark"] .header-light,
html[data-theme="dark"] .header .navbar,
html[data-theme="dark"] .header-fixed.affix .navbar { background-color: rgba(15, 20, 26, 0.97) !important; border-bottom-color: var(--dm-line); }
html[data-theme="dark"] .header .nav-dark,
html[data-theme="dark"] .header .navbar-nav > li > a { color: var(--dm-text) !important; }
html[data-theme="dark"] .header .navbar-toggle .icon-bar { background-color: var(--dm-text); }
html[data-theme="dark"] .navbar-collapse { background-color: transparent; }
@media (max-width: 991px) {
    html[data-theme="dark"] .navbar-collapse { background-color: var(--dm-surface) !important; border-color: var(--dm-line); }
}
html[data-theme="dark"] .ce-account-menu__panel { background: var(--dm-surface-2); border-color: var(--dm-line); box-shadow: 0 16px 40px -18px #000; }
html[data-theme="dark"] .ce-account-menu__panel a,
html[data-theme="dark"] .ce-account-menu__panel button { color: var(--dm-text); }

/* Cards, boxes and panels */
html[data-theme="dark"] .property-item,
html[data-theme="dark"] .ce-card,
html[data-theme="dark"] .property--content,
html[data-theme="dark"] .form-box,
html[data-theme="dark"] .widget,
html[data-theme="dark"] .inner-box,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .ce-plan,
html[data-theme="dark"] .ce-statbox,
html[data-theme="dark"] .ce-mylisting,
html[data-theme="dark"] .ce-topagent { background-color: var(--dm-surface); border-color: var(--dm-line); color: var(--dm-text); }
html[data-theme="dark"] .property--title a,
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6 { color: var(--dm-text); }
html[data-theme="dark"] .ce-card--premium { border-color: var(--gold); }

/* Forms */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] input[type="text"], html[data-theme="dark"] input[type="email"], html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="password"], html[data-theme="dark"] input[type="search"], html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] select, html[data-theme="dark"] textarea {
    background-color: var(--dm-surface-2) !important; color: var(--dm-text) !important; border-color: var(--dm-line) !important;
}
html[data-theme="dark"] ::placeholder { color: #6f7c89 !important; opacity: 1; }
html[data-theme="dark"] .btn-default { background-color: var(--dm-surface-2); color: var(--dm-text); border-color: var(--dm-line); }
html[data-theme="dark"] .btn-default:hover, html[data-theme="dark"] .btn-default:focus { background-color: #24303d; color: #fff; }

/* Photos look a touch less glaring at night. */
html[data-theme="dark"] .property--img img,
html[data-theme="dark"] .ce-mylisting__img img { filter: brightness(.92); }

/* Footer stays dark, just a little deeper. */
html[data-theme="dark"] .footer, html[data-theme="dark"] footer { background-color: #0b0f14; }

/* The switch button in the menu */
.ce-theme-toggle { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font: inherit; display: inline-flex; align-items: center; gap: 6px; }
.ce-theme-toggle__icon { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #f1f3f6; color: #34495e; font-size: 16px; transition: background-color .2s, color .2s; }
.ce-theme-toggle:hover .ce-theme-toggle__icon, .ce-theme-toggle:focus-visible .ce-theme-toggle__icon { background: #ffe9d6; color: #f38321; }
.ce-theme-toggle .fa-sun-o { display: none; }
html[data-theme="dark"] .ce-theme-toggle .fa-moon-o { display: none; }
html[data-theme="dark"] .ce-theme-toggle .fa-sun-o { display: inline-block; }
html[data-theme="dark"] .ce-theme-toggle__icon { background: #222c38; color: #ffcf70; }
.ce-theme-toggle__label { font-size: 13px; text-transform: none; }
@media (min-width: 992px) { .ce-theme-toggle__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
@media (max-width: 991px) { .navbar-nav > li.ce-theme-item > .ce-theme-toggle { padding: 10px 15px; } }

/* Fixes found while checking pages */
html[data-theme="dark"] .btn-outline-brand { background-color: transparent; color: var(--brand); border-color: var(--brand); }
html[data-theme="dark"] .btn-outline-brand:hover { background-color: var(--brand); color: #fff; }
html[data-theme="dark"] .ce-card__tags .ce-tag--inspected { background: #0f7a5c; color: #fff; }
@media (min-width: 992px) {
    .navbar-nav > li.ce-theme-item > .ce-theme-toggle { height: 100px; padding: 0 4px; }
    .header-fixed .navbar.affix .navbar-nav > li.ce-theme-item > .ce-theme-toggle { height: 80px; }
}
html[data-theme="dark"] .ce-plan--diamond .ce-plan__price { background: linear-gradient(120deg, #8ab8ff, #b9a3ff); -webkit-background-clip: text; background-clip: text; }
