/**
 * Açık tema — TKGM kurumsal renk kartelası.
 *
 * Renkler tkgm.gov.tr ana sayfasından örneklendi:
 *   beyaz yüzey #ffffff · yumuşak zemin #eff5fd · kart mavisi #d0dffe
 *   kurumsal mavi #2563b1 · açık mavi #689ff3 · lacivert metin #16233d
 *   ikincil metin #445572 · kurum kırmızısı (CİMER) #e11d2e
 *
 * Koyu tema `style.css` / `landing.css` içindeki mevcut karteladır ve
 * burada hiç değiştirilmez; bu dosya yalnızca `html[data-theme="light"]`
 * altında geçerli olur ve her iki sayfada en son yüklenir.
 */

/* ————— Kartela ————— */
html[data-theme="light"] {
  --bg-dark: #eff4fb;
  --bg-panel: #ffffff;
  --bg-hover: #e3ecfa;
  --border: #ccdaf0;
  --text: #16233d;
  --text-muted: #5a6b86;
  --accent: #2563b1;
  --accent-hover: #1b4c8c;
  --danger: #d92d3c;
  --success: #147a4b;
  --highlight: #b45309;

  /* style.css içinde yedekli kullanılan adlar */
  --bg-input: #ffffff;
  --muted: #5a6b86;

  /* 3B sahne */
  --viewer-bg: #e4ecf9;
  --grid-major: #b7c8e3;
  --grid-minor: #d3dff2;

  color-scheme: light;
}

/* ————— Genel yüzeyler ————— */
[data-theme="light"] .left-tabs,
[data-theme="light"] .right-tabs {
  background: #e7eefa;
}

[data-theme="light"] .left-tab:hover,
[data-theme="light"] .right-tab:hover {
  background: rgba(37, 99, 177, 0.09);
}

[data-theme="light"] td {
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] tbody tr.selected {
  background: rgba(37, 99, 177, 0.14);
}

[data-theme="light"] .layer-swatch {
  border: 1px solid rgba(22, 35, 61, 0.28);
}

[data-theme="light"] .status-bar.success {
  background: rgba(20, 122, 75, 0.12);
}

[data-theme="light"] .status-bar.error {
  background: rgba(217, 45, 60, 0.12);
}

[data-theme="light"] .status-bar.warning {
  background: rgba(180, 83, 9, 0.14);
  color: var(--highlight);
}

[data-theme="light"] .status-bar.info {
  background: rgba(37, 99, 177, 0.12);
}

[data-theme="light"] .loading-overlay {
  background: rgba(239, 244, 251, 0.78);
}

/* ————— Düğmeler ————— */
[data-theme="light"] .btn.accent {
  background: #2563b1;
  border-color: #1b4c8c;
  color: #fff;
}

[data-theme="light"] .btn.accent:hover:not(:disabled) {
  background: #1b4c8c;
}

[data-theme="light"] .btn.accent.active {
  background: #143c6f;
  box-shadow: 0 0 0 2px rgba(37, 99, 177, 0.35);
}

[data-theme="light"] .btn.danger:hover:not(:disabled) {
  background: rgba(217, 45, 60, 0.12);
}

[data-theme="light"] .version-badge {
  background: #147a4b;
  color: #fff;
}

/* ————— Denetim panelleri ————— */
[data-theme="light"] .data-panel h3 {
  color: #0f6b53;
}

[data-theme="light"] .validation-summary {
  background: #f3f7fd;
}

[data-theme="light"] .validation-summary.passed {
  border-color: rgba(20, 122, 75, 0.45);
  background: rgba(20, 122, 75, 0.08);
  color: #10603a;
}

[data-theme="light"] .validation-summary.failed {
  border-color: rgba(217, 45, 60, 0.45);
  background: rgba(217, 45, 60, 0.07);
  color: #a3172a;
}

[data-theme="light"] .validation-summary .val-count.err {
  color: #b91c1c;
}

[data-theme="light"] .validation-summary .val-count.warn {
  color: #92400e;
}

[data-theme="light"] .validation-summary .val-count.info {
  color: #1d4ed8;
}

[data-theme="light"] .validation-bb-chip {
  color: var(--text);
  background: rgba(37, 99, 177, 0.08);
  border-color: rgba(37, 99, 177, 0.28);
}

[data-theme="light"] .validation-bb-chip:hover {
  background: rgba(37, 99, 177, 0.14);
  border-color: rgba(37, 99, 177, 0.4);
}

[data-theme="light"] .validation-bb-chip.is-active {
  color: #0b3d6e;
  background: rgba(37, 99, 177, 0.18);
  border-color: var(--accent);
}

[data-theme="light"] .validation-bb-chip-count {
  color: var(--text-muted);
}

[data-theme="light"] .validation-bb-chip.is-active .validation-bb-chip-count {
  color: #1d4ed8;
}

[data-theme="light"] .validation-block-chip.is-open {
  color: #0b3d6e;
  background: rgba(37, 99, 177, 0.14);
  border-color: rgba(37, 99, 177, 0.45);
}

[data-theme="light"] .validation-issue {
  background: #f6f9fe;
}

[data-theme="light"] .validation-issue.severity-error {
  border-left-color: #d92d3c;
}

[data-theme="light"] .validation-issue.severity-warning {
  border-left-color: #b45309;
}

[data-theme="light"] .validation-issue.severity-info {
  border-left-color: #2563b1;
}

[data-theme="light"] .validation-issue.validation-issue-active {
  outline: 1px solid #b45309;
  background: rgba(180, 83, 9, 0.1);
}

[data-theme="light"] .vi-sev-error {
  background: rgba(217, 45, 60, 0.16);
  color: #a3172a;
}

[data-theme="light"] .vi-sev-warning {
  background: rgba(180, 83, 9, 0.16);
  color: #8a4008;
}

[data-theme="light"] .vi-sev-info {
  background: rgba(37, 99, 177, 0.16);
  color: #1b4c8c;
}

/* ————— Yapı ağacı ————— */
[data-theme="light"] .hierarchy-panel-title:hover {
  background: rgba(37, 99, 177, 0.1);
  color: #1b4c8c;
}

[data-theme="light"] .hierarchy-tree .node-section {
  color: #0f766e;
}

[data-theme="light"] .hierarchy-tree .node-bb-floor {
  color: #15803d;
}

[data-theme="light"] .hierarchy-tree .node-dependent-floor .tree-label {
  color: #0369a1;
}

[data-theme="light"] .hierarchy-tree .node-room {
  color: #6d28d9;
}

[data-theme="light"] .hierarchy-tree .node-common_area {
  color: #92400e;
}

[data-theme="light"] .hierarchy-tree .node-balcony {
  color: #be185d;
}

[data-theme="light"] .hierarchy-tree .node-terrace {
  color: #c2410c;
}

[data-theme="light"] .hierarchy-tree .tree-label.filter-active {
  background: rgba(37, 99, 177, 0.12);
}

[data-theme="light"] .hierarchy-tree .tree-label.validation-hit,
[data-theme="light"] .hierarchy-tree .tree-label.validation-focus {
  box-shadow: inset 0 0 0 1px #d92d3c;
}

[data-theme="light"] .hierarchy-tree .tree-label.validation-focus {
  background: rgba(217, 45, 60, 0.12);
}

/* ————— Öznitelik paneli ————— */
[data-theme="light"] .attr-row,
[data-theme="light"] .building-id-row {
  background: #f5f8fd;
  border: 1px solid var(--border);
}

[data-theme="light"] .building-id-row:hover {
  background: rgba(37, 99, 177, 0.09);
}

[data-theme="light"] .export-block-row {
  background: #f5f8fd;
  border: 1px solid var(--border);
}

[data-theme="light"] .export-block-row:hover,
[data-theme="light"] .export-block-row:has(input:checked) {
  background: rgba(37, 99, 177, 0.09);
}

[data-theme="light"] .attr-key {
  color: #46587a;
}

[data-theme="light"] .attr-desc {
  color: #6b7a94;
}

[data-theme="light"] .attr-entity {
  color: #46587a;
  background: rgba(22, 35, 61, 0.07);
}

[data-theme="light"] .attr-val {
  color: #16233d;
}

[data-theme="light"] .attribute-panel-hint a {
  color: var(--accent);
}

/* ————— ID sorgulama ————— */
[data-theme="light"] .id-search-input {
  background: #ffffff;
}

[data-theme="light"] .id-search-input:focus {
  box-shadow: 0 0 0 2px rgba(37, 99, 177, 0.22);
}

[data-theme="light"] .id-search-results {
  background: #f6f9fe;
}

[data-theme="light"] .id-search-hit,
[data-theme="light"] .id-search-summary {
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .id-search-hit.is-active {
  background: rgba(37, 99, 177, 0.1);
}

[data-theme="light"] .id-search-group-btn {
  color: #16233d;
  background: rgba(22, 35, 61, 0.06);
  border-color: var(--border);
}

[data-theme="light"] .id-search-group-btn.is-active {
  color: #0b3a75;
  background: rgba(37, 99, 177, 0.14);
  border-color: var(--accent);
}

[data-theme="light"] .id-search-group {
  border-bottom-color: var(--border);
}

[data-theme="light"] .id-search-group-toggle:hover,
[data-theme="light"] .id-search-group-toggle.is-open {
  background: rgba(37, 99, 177, 0.08);
}
  background: rgba(37, 99, 177, 0.12);
  color: #1b4c8c;
}

/* ————— Geometri düzenleme (seviye 3) ————— */
[data-theme="light"] .edit-panel {
  border: 1px solid rgba(37, 99, 177, 0.5);
  background: rgba(37, 99, 177, 0.06);
}

[data-theme="light"] .edit-panel h3 {
  color: var(--accent);
}

[data-theme="light"] .edit-selection {
  background: rgba(37, 99, 177, 0.05);
}

[data-theme="light"] .cad-toolbar {
  background: rgba(255, 255, 255, 0.96);
}

[data-theme="light"] .cad-toolbar button {
  background: #e7eefa;
}

[data-theme="light"] .cad-status.snap-flash {
  color: #0f6b53;
  text-shadow: none;
}

[data-theme="light"] .view-cube-face {
  background: rgba(255, 255, 255, 0.94);
  border-color: #9aa8bb;
  color: #33415a;
}

[data-theme="light"] .view-cube-face:hover {
  background: var(--accent);
  color: #ffffff;
}

/* ————— 3B üstü bilgi kutuları ————— */
[data-theme="light"] .feature-stats,
[data-theme="light"] .context-stats,
[data-theme="light"] .viewer-hint,
[data-theme="light"] .map-popup {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  box-shadow: 0 4px 16px rgba(22, 35, 61, 0.14);
}

/* Kot etiketleri 3B sahnede koyu zeminli çiplerdir (`.room-label-elevation`);
   yazı renkleri her iki temada da açık kalır. Açık sahnede çipi biraz
   koyulaştırıp kenarını belirginleştirmek okunurluğu artırır. */
[data-theme="light"] .room-label-elevation {
  background: rgba(12, 58, 31, 0.95);
  border-color: rgba(20, 122, 75, 0.7);
}

[data-theme="light"] .room-label-3d {
  box-shadow: 0 2px 10px rgba(22, 35, 61, 0.25);
}

/* ————— Oturum / KVKK bileşenleri ————— */
[data-theme="light"] .auth-overlay {
  background: rgba(22, 35, 61, 0.45);
}

[data-theme="light"] .auth-modal,
[data-theme="light"] .auth-account-panel {
  box-shadow: 0 16px 40px rgba(22, 35, 61, 0.2);
}

[data-theme="light"] .auth-error {
  color: #a3172a;
  background: rgba(217, 45, 60, 0.1);
  border: 1px solid rgba(217, 45, 60, 0.35);
}

[data-theme="light"] .auth-level-badge[data-level="1"] {
  color: #1b4c8c;
  border-color: rgba(37, 99, 177, 0.45);
}

[data-theme="light"] .auth-level-badge[data-level="2"] {
  color: #10603a;
  border-color: rgba(20, 122, 75, 0.45);
}

[data-theme="light"] .auth-level-badge[data-level="3"] {
  color: #8a4008;
  border-color: rgba(180, 83, 9, 0.45);
}

/* ————— Tema değiştirme düğmesi —————
   Yalnızca simge ve sabit ölçü: tema değişince genişlik değişmediği için
   başlık düzeni kaymaz. */
.theme-toggle {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.theme-toggle-icon {
  font-size: 0.95rem;
  line-height: 1;
}

/* ————— Giriş / tanıtım ekranı (landing) ————— */
html[data-theme="light"] .landing-body {
  background:
    radial-gradient(1100px 620px at 15% -10%, rgba(37, 99, 177, 0.12), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(104, 159, 243, 0.14), transparent 55%),
    #ffffff;
  color: var(--text);
}

[data-theme="light"] .landing-header {
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .landing-rail {
  background: #f4f8fe;
  border-left-color: var(--border);
  box-shadow: -8px 0 20px rgba(22, 35, 61, 0.08);
}

[data-theme="light"] .landing-features li,
[data-theme="light"] .level-card {
  background: #f4f8fe;
  border-color: var(--border);
}

[data-theme="light"] .landing-auth-card {
  box-shadow: 0 18px 44px rgba(22, 35, 61, 0.14);
}

/* Kart beyaz olduğu için onay kutuları hafif mavi zeminle ayrışır */
[data-theme="light"] .landing-consents {
  background: #f4f8fe;
  border-color: var(--border);
}

[data-theme="light"] .landing-form input[type="text"],
[data-theme="light"] .landing-form input[type="email"],
[data-theme="light"] .landing-form input[type="password"] {
  background: #ffffff;
  border-color: var(--border);
}

[data-theme="light"] .landing-note {
  color: #46587a;
  background: rgba(37, 99, 177, 0.07);
  border-color: rgba(37, 99, 177, 0.25);
}

[data-theme="light"] .landing-error {
  color: #a3172a;
  background: rgba(217, 45, 60, 0.1);
  border-color: rgba(217, 45, 60, 0.35);
}

[data-theme="light"] .landing-btn.primary {
  background: linear-gradient(135deg, #2563b1, #3c82d8);
  color: #fff;
}

[data-theme="light"] .landing-btn.primary:hover {
  background: linear-gradient(135deg, #1b4c8c, #2f6fc4);
}

[data-theme="light"] .landing-overlay {
  background: rgba(22, 35, 61, 0.5);
}

[data-theme="light"] .landing-modal {
  box-shadow: 0 18px 44px rgba(22, 35, 61, 0.2);
}

[data-theme="light"] .hesap-stat,
[data-theme="light"] .hesap-section,
[data-theme="light"] .shop-card {
  background: #f4f8fe;
  border-color: var(--border);
}

[data-theme="light"] .hesap-tabs a.is-active {
  background: rgba(37, 99, 177, 0.1);
}

[data-theme="light"] .users-table th {
  background: #e8f0fc;
}

/* ————— Okunurluk: koyu temanın soluk yazı renkleri açık zeminde —————
   Koyu tema için seçilmiş açık yeşil / turuncu / kırmızı / mavi yazılar
   beyaz zeminde 1,2–1,9:1 kontrasta düşüyordu ("Kaydedildi" kutusundaki
   yazı okunmuyordu). Açık temada koyu tonlar: hepsi en az 4,5:1 (WCAG AA). */
[data-theme="light"] .mahalle-ok {
  color: #14532d;
  background: #e8f6ee;
  border-color: #9fd3b4;
}

[data-theme="light"] .status-pending { color: #9a3412; }
[data-theme="light"] .status-fulfilled { color: #166534; }
[data-theme="light"] .status-rejected { color: #b91c1c; }

[data-theme="light"] .id-search-hit:hover,
[data-theme="light"] .id-search-hit.is-active {
  color: #1d4ed8;
}
