/* ==========================================================================
   Like Lombard - Landing Dark Theme
   Activated via <html data-theme="dark">
   ========================================================================== */

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.85);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle-btn:hover,
.theme-toggle-btn:focus {
    background: rgba(255, 255, 255, 0.16);
    color: #ffda00;
    border-color: rgba(255, 218, 0, 0.45);
    outline: none;
}

.theme-toggle-btn .theme-icon-sun {
    display: none;
}

.theme-toggle-btn .theme-icon-moon {
    display: inline-flex;
}

html[data-theme="dark"] .theme-toggle-btn .theme-icon-sun {
    display: inline-flex;
    color: #ffda00;
}

html[data-theme="dark"] .theme-toggle-btn .theme-icon-moon {
    display: none;
}

/* ==========================================================================
   CSS Variables Override & Landing Surfaces (html[data-theme="dark"])
   ========================================================================== */

html[data-theme="dark"] {
    color-scheme: dark;
    --text: #e8e8e8;
    --text-muted: #999999;
    --bg: #1e1e1e;
    --surface: #262626;
    --border: #383838;
    --accent-soft: rgba(255, 218, 0, 0.14);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 12px 36px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] body {
    background-color: #1e1e1e;
    color: #e8e8e8;
}

html[data-theme="dark"] main {
    background-color: #1e1e1e;
    color: #e8e8e8;
}

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: #f0f0f0;
}

/* Landing sub-page hardcoded light surfaces & gradients */
html[data-theme="dark"] .cnt-map-header,
html[data-theme="dark"] .vac-card-header {
    background: linear-gradient(135deg, #2d2d2d 0%, #262626 100%) !important;
    border-bottom-color: #383838 !important;
}

html[data-theme="dark"] .cnt-map-title,
html[data-theme="dark"] .vac-card-title,
html[data-theme="dark"] .main-section-title {
    color: #e8e8e8 !important;
}

html[data-theme="dark"] .cnt-card-badge {
    background: rgba(255, 255, 255, 0.08);
    color: #c7c7c7;
}

html[data-theme="dark"] .cnt-card-badge.badge-shop {
    background: rgba(255, 218, 0, 0.16);
    color: #ffda00;
}

html[data-theme="dark"] .vac-card-badge {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffda00 !important;
}

html[data-theme="dark"] .vac-card-body {
    color: #c7c7c7 !important;
}

html[data-theme="dark"] .cnt-btn-map,
html[data-theme="dark"] .cnt-btn-2gis {
    background-color: #2d2d2d !important;
    color: #e8e8e8 !important;
    border: 1px solid #383838 !important;
}

html[data-theme="dark"] .cnt-btn-map:hover,
html[data-theme="dark"] .cnt-btn-2gis:hover {
    background-color: #363636 !important;
    color: #ffda00 !important;
}

html[data-theme="dark"] .leaflet-popup-content-wrapper,
html[data-theme="dark"] .leaflet-popup-tip {
    background: #262626;
    color: #e8e8e8;
}

html[data-theme="dark"] .cnt-pop-title {
    color: #e8e8e8;
}

/* Leaflet Dark Map (Variant 1: dark filter on tile pane only, preserving Russian OSM labels & markers) */
html[data-theme="dark"] #map {
    background: #1e1e1e;
}

html[data-theme="dark"] #map .leaflet-tile-pane {
    filter: invert(100%) hue-rotate(180deg) brightness(92%) contrast(88%);
}

html[data-theme="dark"] #map .leaflet-control-zoom a {
    background-color: #262626;
    color: #e8e8e8;
    border-color: #383838;
}

html[data-theme="dark"] #map .leaflet-control-zoom a:hover {
    background-color: #363636;
    color: #ffda00;
}

html[data-theme="dark"] #map .leaflet-control-attribution {
    background: rgba(30, 30, 30, 0.8);
    color: #999999;
}

html[data-theme="dark"] #map .leaflet-control-attribution a {
    color: #93c5fd;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .form-control {
    background-color: #262626;
    border-color: #383838;
    color: #e8e8e8;
}

/* Main page calculators (landing/css/main.css) */
html[data-theme="dark"] .calc-card.tech-card {
    border-top-color: #3b82f6;
}

html[data-theme="dark"] .calc-card-header {
    background: linear-gradient(135deg, #2d2d2d 0%, #262626 100%) !important;
    border-bottom-color: #383838 !important;
}

html[data-theme="dark"] .calc-card-title {
    color: #e8e8e8 !important;
}

html[data-theme="dark"] .price-item-box {
    background: #1e1e1e !important;
    border-color: #383838 !important;
}

html[data-theme="dark"] .price-item-label {
    color: #b3b3b3 !important;
}

html[data-theme="dark"] .price-item-val {
    color: #e8e8e8 !important;
}

html[data-theme="dark"] .calc-input,
html[data-theme="dark"] .calc-select {
    background-color: #1a1a1a !important;
    border-color: #383838 !important;
    color: #e8e8e8 !important;
}

html[data-theme="dark"] .calc-input:focus,
html[data-theme="dark"] .calc-select:focus {
    background-color: #1a1a1a !important;
    border-color: #4dabf7 !important;
}

html[data-theme="dark"] .calc-result-box {
    background: linear-gradient(135deg, #2d2d2d 0%, #262626 100%) !important;
    border-color: #383838 !important;
}

html[data-theme="dark"] .calc-res-divider {
    background: #383838 !important;
}

html[data-theme="dark"] .calc-res-val:not(.highlight) {
    color: #e8e8e8 !important;
}

html[data-theme="dark"] .loader {
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: #ffda00;
}

html[data-theme="dark"] .range-input input[type="range"] {
    background: linear-gradient(
        to right,
        #ffda01 0%,
        #ffda01 var(--fill-percent, 0%),
        #3a3a3a var(--fill-percent, 0%),
        #3a3a3a 100%
    );
}

html[data-theme="dark"] .range-input input[type="range"]::-webkit-slider-thumb {
    border-color: #1e1e1e;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .range-input input[type="range"]::-moz-range-thumb {
    border-color: #1e1e1e;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* Privacy page (landing/css/privacy.css) */
html[data-theme="dark"] .toc-list li a {
    color: #c7c7c7;
}

html[data-theme="dark"] .toc-list li a:hover {
    color: #ffda00;
}

html[data-theme="dark"] .info-card {
    background: linear-gradient(135deg, #2d2d2d 0%, #262626 100%) !important;
    border: 1px solid #383838 !important;
}

html[data-theme="dark"] .info-card-text {
    color: #c7c7c7 !important;
}

html[data-theme="dark"] .info-card-text strong {
    color: #f0f0f0 !important;
}

html[data-theme="dark"] .section-header {
    background: #262626 !important;
    color: #e8e8e8 !important;
}

html[data-theme="dark"] .section-header:hover {
    background: #2d2d2d !important;
}

html[data-theme="dark"] .section-title {
    color: #e8e8e8 !important;
}

html[data-theme="dark"] .section-intro,
html[data-theme="dark"] .clause-text,
html[data-theme="dark"] .subsection .clause-text,
html[data-theme="dark"] .term-card .clause-text,
html[data-theme="dark"] .bullet-list li,
html[data-theme="dark"] .right-text {
    color: #c7c7c7 !important;
}

html[data-theme="dark"] .clause-num,
html[data-theme="dark"] .subsection .clause-num,
html[data-theme="dark"] .term-card .clause-num,
html[data-theme="dark"] .right-text strong {
    color: #93c5fd !important;
}

html[data-theme="dark"] .subsection,
html[data-theme="dark"] .right-item {
    background: #202024 !important;
    border-color: #383838 !important;
}

html[data-theme="dark"] .term-card {
    background: #2d2d2d !important;
    border-color: #383838 !important;
}

html[data-theme="dark"] .privacy-section a,
html[data-theme="dark"] .term-card a,
html[data-theme="dark"] .clause-text a {
    color: #4dabf7;
}

/* Documents page (landing/css/documents.css) */
html[data-theme="dark"] .doc-preview {
    background: #1e1e1e;
}

html[data-theme="dark"] .doc-type-badge {
    background: rgba(255, 255, 255, 0.08);
    color: #c7c7c7;
}

html[data-theme="dark"] .doc-link-main {
    color: #93c5fd;
}

html[data-theme="dark"] .doc-link-main:hover {
    color: #ffda00;
}

html[data-theme="dark"] .doc-btn-icon {
    background: #2d2d2d;
    color: #e8e8e8;
    border-color: #383838;
}

html[data-theme="dark"] .doc-btn-icon:hover {
    background: #363636;
    color: #ffda00;
    border-color: #484848;
}

html[data-theme="dark"] .doc-filter-btn:hover {
    color: #e8e8e8;
    border-color: #4dabf7;
}

/* Footer */
html[data-theme="dark"] footer {
    background-color: #1e1e1e;
    color: #c7c7c7;
}

html[data-theme="dark"] footer hr.divider {
    border-top-color: #383838;
}

html[data-theme="dark"] footer label,
html[data-theme="dark"] footer .documents label,
html[data-theme="dark"] footer .contacts label,
html[data-theme="dark"] footer .socials label {
    color: #e8e8e8 !important;
}

html[data-theme="dark"] footer a {
    color: #c7c7c7;
}

html[data-theme="dark"] footer .socials a {
    background-color: #262626 !important;
    border-color: #383838 !important;
    color: #e8e8e8 !important;
}

html[data-theme="dark"] footer .socials a:hover {
    background-color: #363636 !important;
    border-color: #484848 !important;
    color: #ffda00 !important;
}

html[data-theme="dark"] footer .socials img {
    background-color: #2d2d2d;
}

html[data-theme="dark"] footer a:hover,
html[data-theme="dark"] footer .phone:hover {
    color: #ffda00;
}

html[data-theme="dark"] footer .text-muted {
    color: #858585 !important;
}

/* Scrollbar (Light & Dark, uniform narrow 6px) */
*,
html {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

html[data-theme="dark"],
html[data-theme="dark"] * {
    scrollbar-color: #484848 #1e1e1e;
}

html[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1e1e1e;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #484848;
    border-radius: 3px;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #5c5c5c;
}
