/* Demo izleme kabuğu: şablon sitesi çerçevede. Gradyan, parıltı ve hap rozeti yok. Açık ve koyu tema. */

:root {
  --dv-bg: #eef1f5;
  --dv-surface: #ffffff;
  --dv-line: #dfe4ec;
  --dv-ink: #0e1b2a;
  --dv-muted: #5b6675;
  --dv-accent: #1a3f9a;
  --dv-accent-hover: #0b1f44;
  --dv-accent-ink: #ffffff;
  --dv-seg: #e4e9f1;
  --dv-bezel: #161d28;
  --dv-focus: #2459d6;
  --dv-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --dv-bg: #0b1220;
    --dv-surface: #121b2b;
    --dv-line: #243044;
    --dv-ink: #e7ecf3;
    --dv-muted: #9aa6b8;
    --dv-accent: #2f5fc4;
    --dv-accent-hover: #3b6fd8;
    --dv-accent-ink: #ffffff;
    --dv-seg: #1b2639;
    --dv-bezel: #05080d;
    --dv-focus: #7ea3f0;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --dv-bg: #0b1220;
  --dv-surface: #121b2b;
  --dv-line: #243044;
  --dv-ink: #e7ecf3;
  --dv-muted: #9aa6b8;
  --dv-accent: #2f5fc4;
  --dv-accent-hover: #3b6fd8;
  --dv-accent-ink: #ffffff;
  --dv-seg: #1b2639;
  --dv-bezel: #05080d;
  --dv-focus: #7ea3f0;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

body.dv {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--dv-bg);
  color: var(--dv-ink);
  font-family: var(--dv-font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.dv :focus-visible {
  outline: 3px solid var(--dv-focus);
  outline-offset: 2px;
}

/* Üst çubuk */
.dv-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 20px;
  background: var(--dv-surface);
  border-bottom: 1px solid var(--dv-line);
}

.dv-bar__info {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dv-bar__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dv-bar__meta {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.3;
  color: var(--dv-muted);
}

.dv-bar__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Cihaz anahtarı (segment kontrol) */
.dv-devices {
  flex: 0 0 auto;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--dv-seg);
}

.dv-device {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--dv-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.dv-device:hover { color: var(--dv-ink); }

.dv-device[aria-pressed="true"] {
  background: var(--dv-surface);
  color: var(--dv-ink);
  box-shadow: 0 1px 2px rgba(14, 27, 42, .12);
}

/* Düğmeler */
.dv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.dv-btn--ghost {
  color: var(--dv-ink);
  background: var(--dv-surface);
  border-color: var(--dv-line);
}

.dv-btn--ghost:hover { border-color: var(--dv-muted); }

.dv-btn--back { gap: 6px; }

.dv-btn--primary {
  color: var(--dv-accent-ink);
  background: var(--dv-accent);
}

.dv-btn--primary:hover {
  color: var(--dv-accent-ink);
  background: var(--dv-accent-hover);
}

/* Sahne ve çerçeve */
.dv-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dv[data-device="tablet"] .dv-stage,
.dv[data-device="mobile"] .dv-stage {
  padding: 24px;
}

.dv-scale {
  position: relative;
  width: 100%;
  height: 100%;
}

.dv-frame {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--dv-surface);
  transform-origin: 0 0;
}

.dv-iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

/* Tablet: 820 px ekran, çerçeveyle birlikte 852 x 1212 */
.dv[data-device="tablet"] .dv-frame {
  width: 852px;
  height: 1212px;
  padding: 16px;
  border-radius: 28px;
  background: var(--dv-bezel);
}

.dv[data-device="tablet"] .dv-iframe {
  width: 820px;
  height: 1180px;
  border-radius: 14px;
}

/* Telefon: 390 px ekran, çerçeveyle birlikte 414 x 868 */
.dv[data-device="mobile"] .dv-frame {
  width: 414px;
  height: 868px;
  padding: 12px;
  border-radius: 40px;
  background: var(--dv-bezel);
}

.dv[data-device="mobile"] .dv-iframe {
  width: 390px;
  height: 844px;
  border-radius: 28px;
}

/* Orta genişlik (768-1099 px): geri bağlantısı simge olur, metin ekran okuyucuda kalır */
@media (min-width: 768px) and (max-width: 1099px) {
  .dv-btn--back { position: relative; padding: 0 10px; }
  .dv-btn--back .dv-btn__label {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
}

/* Dar ekran (<768 px): cihaz anahtarı yok, demo tam ekran, altta ince çubuk */
.dv-mobilebar { display: none; }

@media (max-width: 767px) {
  .dv-bar,
  .dv-devices { display: none; }

  .dv .dv-stage,
  .dv[data-device="tablet"] .dv-stage,
  .dv[data-device="mobile"] .dv-stage {
    padding: 0 !important;
  }

  .dv .dv-scale {
    width: 100% !important;
    height: 100% !important;
  }

  .dv .dv-frame,
  .dv[data-device="tablet"] .dv-frame,
  .dv[data-device="mobile"] .dv-frame {
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: var(--dv-surface);
    transform: none !important;
  }

  .dv .dv-iframe,
  .dv[data-device="tablet"] .dv-iframe,
  .dv[data-device="mobile"] .dv-iframe {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .dv-mobilebar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 60px;
    padding: 8px 12px;
    background: var(--dv-surface);
    border-top: 1px solid var(--dv-line);
  }

  .dv-mobilebar__back {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: var(--dv-ink);
  }

  .dv-mobilebar__title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .dv-mobilebar .dv-btn {
    flex: 0 0 auto;
    padding: 0 14px;
  }
}
