/**
 * Mode gelap — halaman publik (html[data-bs-theme="dark"])
 * Melengkapi theme.css & mbarep-header: permukaan, teks, kartu, form.
 */

html[data-bs-theme='dark'] {
    color-scheme: dark;
    --tt-text: #cbd5e1;
    --tt-text-muted: #94a3b8;
    --tt-light: #1e293b;
    --tt-lighter: #0f172a;
    --tt-border: #334155;
    --tt-primary-light: rgba(27, 110, 79, 0.28);
    --tt-accent-light: rgba(212, 160, 60, 0.12);
    --tt-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --tt-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    --tt-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
    --tt-surface-elevated: #1e293b;
    --tt-surface-input: #0f172a;
}

html[data-bs-theme='dark'] body {
    background: var(--tt-lighter);
    color: var(--tt-text);
}

html[data-bs-theme='dark'] ::-webkit-scrollbar-track {
    background: #1e293b;
}

html[data-bs-theme='dark'] ::-webkit-scrollbar-thumb {
    background: #475569;
}

/* Judul: teks terang (var(--tt-dark) di theme = gelap — tidak cocok di mode gelap) */
html[data-bs-theme='dark'] h1,
html[data-bs-theme='dark'] h2,
html[data-bs-theme='dark'] h3,
html[data-bs-theme='dark'] h4,
html[data-bs-theme='dark'] h5,
html[data-bs-theme='dark'] h6 {
    color: #f1f5f9;
}

/* Area yang memang gelap di light mode — pertahankan kontras */
html[data-bs-theme='dark'] .tt-section-dark h1,
html[data-bs-theme='dark'] .tt-section-dark h2,
html[data-bs-theme='dark'] .tt-section-dark h3,
html[data-bs-theme='dark'] .tt-section-dark h4,
html[data-bs-theme='dark'] .tt-cta h2,
html[data-bs-theme='dark'] .tt-footer h4,
html[data-bs-theme='dark'] .tt-footer h5 {
    color: #fff;
}

html[data-bs-theme='dark'] .tt-subtitle {
    color: var(--tt-text-muted);
}

html[data-bs-theme='dark'] a:hover {
    color: #5eead4;
}

/* Kartu & permukaan putih */
html[data-bs-theme='dark'] .tt-dest-card,
html[data-bs-theme='dark'] .tt-feature-card,
html[data-bs-theme='dark'] .tt-testimonial-card,
html[data-bs-theme='dark'] .tt-blog-card,
html[data-bs-theme='dark'] .tt-contact-card,
html[data-bs-theme='dark'] .tt-search-bar,
html[data-bs-theme='dark'] .tt-cart-summary,
html[data-bs-theme='dark'] .tt-accordion .accordion-item {
    background: var(--tt-surface-elevated);
    border-color: var(--tt-border);
    box-shadow: none;
}

/* Kartu sidebar (beranda: Portofolio / lini layanan — theme memakai background #fff) */
html[data-bs-theme='dark'] .tt-sidebar-card {
    background: var(--tt-surface-elevated);
    border-color: var(--tt-border);
    box-shadow: none;
}

html[data-bs-theme='dark'] .tt-sidebar-card .tt-info-row {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

html[data-bs-theme='dark'] .tt-sidebar-card .tt-info-label {
    color: var(--tt-text-muted);
}

html[data-bs-theme='dark'] .tt-sidebar-card .tt-info-value {
    color: #e2e8f0;
}

html[data-bs-theme='dark'] .tt-sidebar-card .tt-info-icon {
    background: rgba(27, 110, 79, 0.38);
    color: #bbf7d0;
}

html[data-bs-theme='dark'] .tt-dest-card-title,
html[data-bs-theme='dark'] .tt-dest-card-title a {
    color: #f1f5f9;
}

html[data-bs-theme='dark'] .tt-dest-card-title a:hover {
    color: var(--tt-accent);
}

html[data-bs-theme='dark'] .tt-blog-card-title a {
    color: #f1f5f9;
}

html[data-bs-theme='dark'] .tt-blog-card-title a:hover {
    color: #5eead4;
}

html[data-bs-theme='dark'] .tt-dest-card-footer {
    background: rgba(15, 23, 42, 0.65);
    border-top-color: var(--tt-border);
}

/* Referensi klien / testimoni: theme memakai var(--tt-dark) untuk nama — harus terang di mode gelap */
html[data-bs-theme='dark'] .tt-testimonial-name {
    color: #f1f5f9;
}

html[data-bs-theme='dark'] .tt-contact-card h5 {
    color: #f1f5f9;
}

html[data-bs-theme='dark'] .tt-accordion .accordion-button {
    background: var(--tt-surface-elevated);
    color: #f1f5f9;
}

html[data-bs-theme='dark'] .tt-accordion .accordion-button:not(.collapsed) {
    background: rgba(27, 110, 79, 0.2);
    color: #ecfdf5;
}

html[data-bs-theme='dark'] .tt-accordion .accordion-body {
    background: var(--tt-surface-elevated);
    color: var(--tt-text);
}

/* Form */
html[data-bs-theme='dark'] .tt-input,
html[data-bs-theme='dark'] .tt-select,
html[data-bs-theme='dark'] .tt-form-input,
html[data-bs-theme='dark'] .tt-form-textarea,
html[data-bs-theme='dark'] textarea.tt-textarea {
    background: var(--tt-surface-input);
    color: var(--tt-text);
    border-color: var(--tt-border);
}

html[data-bs-theme='dark'] .tt-input:focus,
html[data-bs-theme='dark'] .tt-select:focus,
html[data-bs-theme='dark'] .tt-form-input:focus,
html[data-bs-theme='dark'] .tt-form-textarea:focus,
html[data-bs-theme='dark'] textarea.tt-textarea:focus {
    border-color: var(--tt-primary);
    box-shadow: 0 0 0 3px rgba(27, 110, 79, 0.25);
}

html[data-bs-theme='dark'] .tt-form-label {
    color: #e2e8f0;
}

html[data-bs-theme='dark'] .tt-label {
    color: var(--tt-text-muted);
}

/* Bootstrap di konten publik */
html[data-bs-theme='dark'] .card {
    background-color: var(--tt-surface-elevated);
    border-color: var(--tt-border);
    color: var(--tt-text);
}

html[data-bs-theme='dark'] .card-header {
    background: rgba(15, 23, 42, 0.6);
    border-bottom-color: var(--tt-border);
    color: #f1f5f9;
}

html[data-bs-theme='dark'] .list-group-item {
    background: var(--tt-surface-elevated);
    border-color: var(--tt-border);
    color: var(--tt-text);
}

html[data-bs-theme='dark'] .border,
html[data-bs-theme='dark'] .border-top,
html[data-bs-theme='dark'] .border-bottom {
    border-color: var(--tt-border) !important;
}

html[data-bs-theme='dark'] .bg-white {
    background-color: var(--tt-surface-elevated) !important;
}

html[data-bs-theme='dark'] .bg-light {
    background-color: #1e293b !important;
}

html[data-bs-theme='dark'] .text-dark {
    color: #e2e8f0 !important;
}

html[data-bs-theme='dark'] .shadow,
html[data-bs-theme='dark'] .shadow-sm {
    box-shadow: var(--tt-shadow) !important;
}

/* Tombol putih di atas latar gelap */
html[data-bs-theme='dark'] .btn-tt-white {
    background: #f1f5f9;
    color: var(--tt-primary);
}

html[data-bs-theme='dark'] .btn-tt-white:hover {
    background: #fff;
    color: var(--tt-primary-dark);
}

html[data-bs-theme='dark'] .btn-tt-accent {
    color: #0f172a;
}

/* Footer: sedikit lebih “deep” dari body */
html[data-bs-theme='dark'] .tt-footer {
    background: #020617;
}

html[data-bs-theme='dark'] .tt-mission-card,
html[data-bs-theme='dark'] .tt-cat-card {
    background: var(--tt-surface-elevated);
}

html[data-bs-theme='dark'] .tt-value-card {
    background: rgba(27, 110, 79, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

html[data-bs-theme='dark'] .tt-value-card h4 {
    color: #f1f5f9;
}

html[data-bs-theme='dark'] .modal-content {
    background: var(--tt-surface-elevated);
    border-color: var(--tt-border);
    color: var(--tt-text);
}

html[data-bs-theme='dark'] .modal-header {
    border-bottom-color: var(--tt-border);
}

html[data-bs-theme='dark'] .dropdown-menu {
    background: var(--tt-surface-elevated);
    border-color: var(--tt-border);
}

html[data-bs-theme='dark'] .dropdown-item {
    color: var(--tt-text);
}

html[data-bs-theme='dark'] .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

/* Alert: kurangi silau di latar gelap */
html[data-bs-theme='dark'] .alert-info {
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(14, 165, 233, 0.35);
    color: #bae6fd;
}

html[data-bs-theme='dark'] .alert-warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fde68a;
}

html[data-bs-theme='dark'] .alert-success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
}

html[data-bs-theme='dark'] .alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fecaca;
}

/* Akun / pesanan */
html[data-bs-theme='dark'] .tt-account-booking-amount__value {
    color: #f1f5f9;
}

html[data-bs-theme='dark'] .tt-account-pj-box {
    background: linear-gradient(135deg, rgba(27, 110, 79, 0.18) 0%, rgba(30, 41, 59, 0.95) 100%);
}

html[data-bs-theme='dark'] .table {
    --bs-table-bg: transparent;
    color: var(--tt-text);
}

html[data-bs-theme='dark'] .table > :not(caption) > * > * {
    border-bottom-color: var(--tt-border);
}

/* Navbar legacy (jika ada halaman lama) */
@media (max-width: 991.98px) {
    html[data-bs-theme='dark'] .tt-navbar .navbar-collapse {
        background: var(--tt-surface-elevated);
        border: 1px solid var(--tt-border);
    }
}
