/* Kabasakal demos — loader, tema, powered by, responsive paylaşımları */
:root {
  --loader-bg: rgba(10, 14, 20, 0.72);
  --loader-bar: #2dd4bf;
  --powered-muted: #8b95a8;
  --powered-bg: rgba(255, 255, 255, 0.04);
  --ease-smooth: cubic-bezier(0.33, 1, 0.68, 1);
}

/* —— Page loader —— */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--loader-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-smooth), visibility 0.35s;
}
.page-loader.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.page-loader.is-exit {
  opacity: 0;
  visibility: hidden;
}
.page-loader__bar {
  width: min(200px, 42vw);
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.page-loader__bar span {
  display: block;
  height: 100%;
  width: 35%;
  background: var(--loader-bar);
  border-radius: 3px;
  animation: loaderSlide 0.9s var(--ease-smooth) infinite;
}
@keyframes loaderSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}
.page-loader__label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--powered-muted);
}

.content-transition {
  animation: contentIn 0.32s var(--ease-smooth);
}
@keyframes contentIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .page-loader,
  .page-loader__bar span,
  .content-transition {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

/* —— Powered by —— */
.powered-by {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--powered-bg);
  text-decoration: none;
  color: var(--powered-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: opacity 0.2s, background 0.2s;
}
.powered-by:hover { opacity: 0.9; }
.powered-by span { white-space: nowrap; }
.powered-by img {
  height: 22px;
  width: auto;
  display: block;
  object-fit: contain;
}
.powered-by--block {
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  width: 100%;
  justify-content: center;
}
.powered-by--block img { height: 26px; }

.powered-by-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}
.demo-store .footer-legal-inner .powered-by-row {
  margin-top: 4px;
  padding-top: 0;
  border-top: none;
  justify-content: flex-start;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  background: var(--elevated, rgba(255, 255, 255, 0.06));
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: grid;
  place-items: center;
  color: inherit;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.12s;
}
.theme-toggle:active { transform: scale(0.96); }

/* ═══════════════════════════════════════
   LIGHT — Vitrin (demo-store)
   ═══════════════════════════════════════ */
html[data-theme="light"] {
  --loader-bg: rgba(248, 250, 252, 0.88);
  --loader-bar: #0d9488;
  --powered-muted: #64748b;
  --powered-bg: rgba(15, 23, 42, 0.05);
}

html[data-theme="light"] body.demo-store {
  --bg: #f8fafc;
  --bg-2: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --strip-bg: #e8edf4;
  --border: rgba(15, 23, 42, 0.1);
  --text: #0f172a;
  --muted: #64748b;
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
  --orange-dim: rgba(255, 106, 46, 0.12);
  --green-dim: rgba(34, 197, 94, 0.12);
  --purple-dim: rgba(139, 92, 246, 0.1);
  color: var(--text);
  background:
    radial-gradient(900px 420px at 20% -10%, rgba(255, 106, 46, 0.07), transparent 60%),
    radial-gradient(700px 400px at 85% 5%, rgba(139, 92, 246, 0.06), transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 55%, #e8edf4 100%) !important;
}

html[data-theme="light"] body.demo-store .header-shell {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 250, 252, 0.95) 100%) !important;
  border-bottom-color: var(--border) !important;
}
html[data-theme="light"] body.demo-store .brand-ks { color: var(--text) !important; }
html[data-theme="light"] body.demo-store .search-kaba-cat {
  background: #e2e8f0 !important;
  color: var(--text) !important;
}
html[data-theme="light"] body.demo-store .search-kaba input::placeholder { color: #94a3b8 !important; }
html[data-theme="light"] body.demo-store .icon-btn:hover {
  border-color: rgba(15, 23, 42, 0.18) !important;
}
html[data-theme="light"] body.demo-store .header-extras {
  border-color: var(--border) !important;
  background: var(--strip-bg) !important;
}
html[data-theme="light"] body.demo-store .q-game {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: var(--border) !important;
}
html[data-theme="light"] body.demo-store .q-game.is-scene-on {
  background: var(--orange-dim) !important;
  border-color: rgba(255, 106, 46, 0.35) !important;
}
html[data-theme="light"] body.demo-store .hero-kaba {
  background: #e2e8f0 !important;
  box-shadow: var(--shadow) !important;
}
html[data-theme="light"] body.demo-store .hero-kaba-bg::after {
  background: linear-gradient(105deg, rgba(248, 250, 252, 0.94) 0%, rgba(248, 250, 252, 0.55) 50%, rgba(248, 250, 252, 0.25) 100%) !important;
}
html[data-theme="light"] body.demo-store .hero-copy h1 {
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.8) !important;
  color: var(--text) !important;
}
html[data-theme="light"] body.demo-store .hero-copy p { color: var(--muted) !important; }
html[data-theme="light"] body.demo-store .hero-hint {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: var(--border) !important;
  color: var(--muted) !important;
}
html[data-theme="light"] body.demo-store .deal,
html[data-theme="light"] body.demo-store .l-card,
html[data-theme="light"] body.demo-store .blog-card,
html[data-theme="light"] body.demo-store .auth-card,
html[data-theme="light"] body.demo-store .panel-main,
html[data-theme="light"] body.demo-store .panel-side,
html[data-theme="light"] body.demo-store .prod-card-cat,
html[data-theme="light"] body.demo-store .cat-tile,
html[data-theme="light"] body.demo-store .carousel-slide,
html[data-theme="light"] body.demo-store .ho-card {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
html[data-theme="light"] body.demo-store .site-footer,
html[data-theme="light"] body.demo-store .footer-mega,
html[data-theme="light"] body.demo-store .footer-trust {
  background: #eef2f7 !important;
  border-color: var(--border) !important;
}
html[data-theme="light"] body.demo-store .footer-legal {
  background: #e2e8f0 !important;
  color: var(--muted) !important;
  border-top-color: var(--border) !important;
}
html[data-theme="light"] body.demo-store .footer-legal-links a { color: var(--muted) !important; }
html[data-theme="light"] body.demo-store .footer-pill {
  background: #fff !important;
  border-color: var(--border) !important;
}
html[data-theme="light"] body.demo-store .toast {
  background: var(--surface) !important;
  box-shadow: var(--shadow) !important;
}
html[data-theme="light"] body.demo-store .page-loader__bar {
  background: rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] body.demo-store .deals-row,
html[data-theme="light"] body.demo-store .section-head,
html[data-theme="light"] body.demo-store .listings-block,
html[data-theme="light"] body.demo-store .blog-strip,
html[data-theme="light"] body.demo-store .page-category .filter-chip,
html[data-theme="light"] body.demo-store .prod-card-cat .pc-body {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
html[data-theme="light"] body.demo-store .deal-art,
html[data-theme="light"] body.demo-store .blog-img,
html[data-theme="light"] body.demo-store .l-thumb {
  background: #e2e8f0 !important;
}
html[data-theme="light"] body.demo-store .tabs-bar {
  background: var(--strip-bg) !important;
  border-color: var(--border) !important;
}
html[data-theme="light"] body.demo-store .tab.is-on {
  background: var(--surface) !important;
  color: var(--text) !important;
}
html[data-theme="light"] body.demo-store .icon-btn.glass {
  background: var(--surface) !important;
}

/* ═══════════════════════════════════════
   LIGHT — Back-office (demo-bo)
   ═══════════════════════════════════════ */
html[data-theme="light"] body.demo-bo {
  --ink: #eef2f7;
  --surface: #ffffff;
  --elevated: #f8fafc;
  --elevated-2: #e2e8f0;
  --border: rgba(15, 23, 42, 0.1);
  --text: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --teal: #0d9488;
  --teal-dim: rgba(13, 148, 136, 0.12);
  --amber: #d97706;
  --amber-dim: rgba(245, 158, 11, 0.14);
  --coral: #dc2626;
  --coral-dim: rgba(239, 68, 68, 0.1);
  --violet: #7c3aed;
  --violet-dim: rgba(124, 58, 237, 0.1);
  --on-primary: #ffffff;
  --row-hover: rgba(15, 23, 42, 0.04);
  --modal-shadow: 0 24px 60px rgba(15, 23, 42, 0.15);
  --backdrop: rgba(15, 23, 42, 0.45);
  background: var(--ink) !important;
  color: var(--text);
}

html[data-theme="dark"] body.demo-bo {
  --on-primary: #0a0e14;
  --row-hover: rgba(255, 255, 255, 0.03);
  --modal-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  --backdrop: rgba(0, 0, 0, 0.6);
}

html[data-theme="light"] body.demo-bo .main {
  background:
    radial-gradient(600px 300px at 100% 0%, var(--violet-dim), transparent 50%),
    var(--ink) !important;
}
html[data-theme="light"] body.demo-bo .sidebar,
html[data-theme="light"] body.demo-bo .topbar {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
html[data-theme="light"] body.demo-bo .demo-banner {
  background: var(--amber-dim) !important;
  color: #92400e !important;
  border-bottom-color: rgba(217, 119, 6, 0.2) !important;
}
html[data-theme="light"] body.demo-bo .demo-banner a { color: var(--teal) !important; }
html[data-theme="light"] body.demo-bo tbody tr:hover td {
  background: var(--row-hover) !important;
}
html[data-theme="light"] body.demo-bo .btn--primary {
  color: var(--on-primary) !important;
}
html[data-theme="light"] body.demo-bo .brand-mark {
  color: var(--on-primary) !important;
}
html[data-theme="light"] body.demo-bo .modal-backdrop.is-open {
  background: var(--backdrop) !important;
}
html[data-theme="light"] body.demo-bo .modal {
  box-shadow: var(--modal-shadow) !important;
}
html[data-theme="light"] body.demo-bo .overlay {
  background: var(--backdrop) !important;
}

/* Logo — açık zeminde PNG, koyu zeminde hafif çerçeve */
html[data-theme="dark"] .powered-by img {
  border-radius: 4px;
}

/* ═══════════════════════════════════════
   RESPONSIVE — Back-office
   ═══════════════════════════════════════ */
@media (max-width: 1100px) {
  body.demo-bo .tenant-select .tenant-btn:not(.is-active) {
    padding: 6px 8px;
    font-size: 0.65rem;
  }
}

@media (max-width: 900px) {
  body.demo-bo .app {
    height: 100dvh;
  }
  body.demo-bo .sidebar {
    grid-row: auto;
  }
  body.demo-bo .main {
    min-height: 0;
  }
  body.demo-bo .topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--top-h, 56px);
    padding: 8px 12px;
    gap: 8px;
  }
  body.demo-bo .breadcrumb {
    order: 2;
    flex: 1 1 100%;
    font-size: 0.8rem;
    padding-bottom: 2px;
  }
  body.demo-bo .toggle-side { order: 0; }
  body.demo-bo .tenant-select {
    order: 1;
    flex: 1;
    justify-content: flex-end;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  body.demo-bo .tenant-select::-webkit-scrollbar { display: none; }
  body.demo-bo .theme-toggle,
  body.demo-bo .notif-btn { order: 3; }
  body.demo-bo .user-chip {
    order: 4;
  }
  body.demo-bo .user-chip span:last-child {
    display: none;
  }
  body.demo-bo .content {
    padding: 14px 12px;
  }
  body.demo-bo .demo-banner {
    flex-direction: column;
    align-items: flex-start;
    font-size: 0.75rem;
    padding: 8px 12px;
  }
  body.demo-bo .page-head h1 {
    font-size: 1.15rem;
  }
  body.demo-bo .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  body.demo-bo .filter-bar input,
  body.demo-bo .filter-bar select {
    min-width: 0;
    flex: 1 1 calc(50% - 8px);
  }
  body.demo-bo .filter-bar input[type="search"] {
    flex: 1 1 100%;
  }
  body.demo-bo .table-wrap {
    margin: 0 -4px;
    border-radius: 8px;
  }
  body.demo-bo table {
    font-size: 0.78rem;
  }
  body.demo-bo th,
  body.demo-bo td {
    padding: 8px 10px;
  }
  body.demo-bo .row-actions {
    flex-direction: column;
    align-items: stretch;
  }
  body.demo-bo .modal--drawer {
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    top: auto;
    height: min(88vh, 520px);
    bottom: 0;
    right: 0;
    left: 0;
    animation: drawerUp 0.28s var(--ease-smooth, ease);
  }
  @keyframes drawerUp {
    from { transform: translateY(100%); }
    to { transform: none; }
  }
  body.demo-bo .detail-grid {
    grid-template-columns: 1fr;
  }
  body.demo-bo .toast-stack {
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  body.demo-bo .toast {
    max-width: none;
  }
}

@media (max-width: 520px) {
  body.demo-bo .kpi-grid {
    grid-template-columns: 1fr;
  }
  body.demo-bo .tenant-btn {
    padding: 5px 7px !important;
    font-size: 0.6rem !important;
  }
  body.demo-bo .page-actions {
    width: 100%;
  }
  body.demo-bo .page-actions .btn {
    flex: 1;
    justify-content: center;
  }
  body.demo-bo .card-grid {
    grid-template-columns: 1fr;
  }
  body.demo-bo .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  body.demo-bo .modal:not(.modal--drawer) {
    width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
  }
}

/* ═══════════════════════════════════════
   RESPONSIVE — Vitrin footer / powered by
   ═══════════════════════════════════════ */
@media (max-width: 640px) {
  body.demo-store .footer-legal-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  body.demo-store .footer-legal-inner .powered-by-row {
    justify-content: flex-start;
  }
  body.demo-store .footer-legal-links {
    justify-content: flex-start;
  }
}

@media (max-width: 380px) {
  .powered-by {
    flex-wrap: wrap;
    justify-content: center;
  }
  .powered-by img {
    height: 20px;
  }
}
