/* ===================================================
   Qonaq — Dark theme + Lang/Theme switcher UI
   Loaded by every page
   =================================================== */

/* ---------- Dark mode variable overrides ---------- */
[data-theme="dark"] {
  --ink:    #e2e8f0;
  --ink-2:  #cbd5e1;
  --muted:  #94a3b8;
  --accent: #2dd4bf;
  --accent-2: #38bdf8;
  --paper:  #1e293b;
  --bg:     #0f172a;
  --hero:   #0f1f2e;
  --card:   #1e293b;
  --border: #334155;
  --line:   #334155;
  --white:  #1e293b;
  --shadow: 0 12px 30px rgba(0,0,0,.45);
  --r: 16px;
}

[data-theme="dark"] body {
  background: var(--bg);
  color: var(--ink);
}

[data-theme="dark"] header {
  background: #0d1625 !important;
  border-bottom: 1px solid #1e2f45 !important;
  box-shadow: none !important;
}

[data-theme="dark"] footer {
  background: #0d1625 !important;
  border-top: 1px solid #1e2f45 !important;
  color: var(--muted);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #64748b !important;
}

[data-theme="dark"] .card,
[data-theme="dark"] .form-card,
[data-theme="dark"] .item,
[data-theme="dark"] .bk-item,
[data-theme="dark"] [class*="card"] {
  background: #1e293b !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .tab-bar,
[data-theme="dark"] .tab {
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}

[data-theme="dark"] .tab.active {
  color: var(--accent);
  border-color: var(--accent);
}

[data-theme="dark"] .btn {
  border-color: #334155;
  color: var(--ink);
}

[data-theme="dark"] a { color: var(--accent); }
[data-theme="dark"] a:hover { color: var(--accent-2); }

[data-theme="dark"] .badge {
  background: #1e293b !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .cover-empty {
  background: #1e293b !important;
  color: #64748b !important;
}

[data-theme="dark"] .hero,
[data-theme="dark"] section.hero,
[data-theme="dark"] [class*="hero"] {
  background: var(--hero) !important;
}

/* ---------- Lang/Theme switcher UI ---------- */

/* Theme toggle button */
.theme-toggle-btn {
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 17px;
  padding: 5px 8px;
  border-radius: 8px;
  line-height: 1;
  color: inherit;
  transition: background .15s;
  display: flex;
  align-items: center;
}
.theme-toggle-btn:hover {
  background: rgba(0,0,0,.06);
}
[data-theme="dark"] .theme-toggle-btn:hover {
  background: rgba(255,255,255,.08);
}

/* Lang dropdown wrapper */
.lang-wrap {
  position: relative;
}
.lang-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  user-select: none;
  transition: background .15s;
  color: inherit;
}
.lang-trigger:hover {
  background: rgba(0,0,0,.06);
}
[data-theme="dark"] .lang-trigger:hover {
  background: rgba(255,255,255,.08);
}
.lang-trigger .arrow {
  font-size: 10px;
  opacity: .6;
}
.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--paper, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 90px;
  z-index: 999;
  overflow: hidden;
}
[data-theme="dark"] .lang-menu {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.lang-wrap.open .lang-menu { display: block; }
.lang-menu button {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 9px 14px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, #64748b);
  transition: background .12s, color .12s;
}
.lang-menu button:hover {
  background: var(--hero, #e9f7f6);
  color: var(--accent, #1bb4b0);
}
[data-theme="dark"] .lang-menu button:hover {
  background: #0f2030;
}
.lang-menu button.active {
  color: var(--accent, #1bb4b0);
  font-weight: 800;
}
