html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* Admin floating save between columns */
.editor-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  position: relative;
  padding-bottom: 3.5rem; /* space for the floating button */
}

.floating-save {
  position: absolute;
  left: 50%;
  transform: translate(-50%, 50%);
  bottom: 0;
  z-index: 10;
  padding-left: 2rem;
  padding-right: 2rem;
  width: auto !important;
  display: inline-flex;
  white-space: nowrap;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Prompter Styles */
.prompter-wrapper {
  position: relative;
  min-height: calc(100vh - 120px);
  background: transparent;
  color: #111111;
  border-radius: .5rem;
  padding: 1rem;
}

.prompter-content {
  height: 100%;
  padding: 2rem 1rem 6rem 1rem;
  overflow: auto;
}

/* Scaled prompter canvas to keep pixel-perfect layout */
.prompter-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  /* leave bottom padding for fixed mics visually via container height calculation in JS */
}

.prompter-stage {
  /* Design resolution to match preview proportions; keep stable for pixel-perfect scaling */
  width: 1280px;
  height: 720px;
  transform-origin: top center;
  will-change: transform;
}

/* Inside stage, use same typography as preview for 1:1 alignment */
.prompter-stage .prompter-text {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.42;
  padding: 12px 15px;
  box-sizing: border-box;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  outline: none;
  height: 100%;
  overflow: hidden;
  text-align: left;
  font-weight: 400;
}

/* Mikrofonlar yatay büyük */
.prompter-mics {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  right: 1.5rem; /* stretch to full width so justify-between works */
}

.mic-item { display:none; }

.mic-btn {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  border: none;
  background: #d9d9de; /* disabled gri */
  color: #4a4f66;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  transition: transform .1s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
  box-shadow: 0 6px 16px rgba(0,0,0,.35);
  position: relative;
}

/* Bağlı/bağlı değil ikon görünürlüğü */
.mic-btn .icon-connected,
.mic-btn .icon-disconnected { display: none; }
.mic-btn .icon-disconnected { display: block; }
.mic-btn.connected .icon-disconnected { display: none; }
.mic-btn.connected .icon-connected { display: block; }

.mic-btn:active {
  transform: scale(.96);
}

.mic-btn:hover {
  filter: brightness(.98);
}

.mic-btn.connected {
  background: #f2d14b; /* stüdyo sarısı (hafif kırık sarı) */
  color: #372d0a;
}

.mic-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0,0,0,.15);
  color: #111111;
  font-weight: 800;
  font-size: 24px;
  line-height: 1;
  padding: .25rem .5rem;
  border-radius: 8px;
}

.help-btn {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: none;
  background: #2a2f45;
  color: #ffd166;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  box-shadow: 0 6px 16px rgba(0,0,0,.35);
}

.help-btn:hover {
  background: #333a55;
  color: #ffe08a;
}

.help-btn.hidden { display: none; }

@keyframes pulseOnce {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.6); }
  70% { transform: scale(1); box-shadow: 0 0 0 18px rgba(255, 209, 102, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 209, 102, 0); }
}

.help-btn.pulse {
  animation: pulseOnce .8s ease-out 1;
}

.help-btn.pulsing {
  animation: pulseOnce 1s ease-out infinite;
}

/* Admin Dashboard editor/preview layout */
.editor-preview-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* left | button | right */
  gap: 1rem;
  align-items: end; /* bottom align items */
}

.between-column { display: flex; align-items: flex-end; }

.ep-surface {
  height: 420px;
}

#editor.ep-surface .ql-container {
  height: 420px !important;
}
#editor.ep-surface .ql-editor {
  height: 100% !important;
}

/* Pixel-perfect match between editor and preview */
#preview.ep-surface,
#editor.ep-surface .ql-editor {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  font-size: 13px !important;
  line-height: 1.42 !important;
  padding: 12px 15px !important;
  box-sizing: border-box !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  margin: 0 !important;
  border: none !important;
  outline: none !important;
  height: 400px !important;
  overflow-y: auto !important;
}

#preview.ep-surface {
  background: #0f1115 !important;
  color: #eaecee !important;
}

#editor.ep-surface .ql-editor {
  background: white !important;
  color: black !important;
}

/* Force EXACT same spacing for both editors */
#preview.ep-surface .ql-editor,
#editor.ep-surface .ql-editor {
  font-size: 13px !important;
  line-height: 1.42 !important;
  padding: 12px 15px !important;
}

/* Remove ALL default Quill margins to match exactly */
#preview.ep-surface .ql-editor * {
  margin: 0 !important;
  margin-bottom: 0 !important;
  margin-top: 0 !important;
}

#preview.ep-surface .ql-editor p,
#editor.ep-surface .ql-editor p {
  margin: 0 !important;
  line-height: 1.42 !important;
  margin-bottom: 0 !important;
}

#preview.ep-surface .ql-editor h1, #preview.ep-surface .ql-editor h2, #preview.ep-surface .ql-editor h3,
#preview.ep-surface .ql-editor h4, #preview.ep-surface .ql-editor h5, #preview.ep-surface .ql-editor h6,
#editor.ep-surface .ql-editor h1, #editor.ep-surface .ql-editor h2, #editor.ep-surface .ql-editor h3,
#editor.ep-surface .ql-editor h4, #editor.ep-surface .ql-editor h5, #editor.ep-surface .ql-editor h6 {
  margin: 0 !important;
  margin-bottom: 0 !important;
  line-height: 1.42 !important;
}

#preview.ep-surface .ql-editor ul, #preview.ep-surface .ql-editor ol,
#editor.ep-surface .ql-editor ul, #editor.ep-surface .ql-editor ol {
  margin: 0 !important;
  margin-bottom: 0 !important;
  padding-left: 1.5em !important;
}

#preview.ep-surface .ql-editor li,
#editor.ep-surface .ql-editor li {
  margin: 0 !important;
  line-height: 1.42 !important;
}

/* Header script selector - text-like appearance */
#headerScriptSelector {
  border: none !important;
  background: none !important;
  padding: 1px 4px !important;
  border-radius: 3px !important;
  transition: all 0.2s ease;
  font-size: 0.8rem !important;
}

#headerScriptSelector:hover {
  background-color: #f8f9fa !important;
  color: #0d6efd !important;
}

#headerScriptSelector::after {
  margin-left: 3px;
  vertical-align: middle;
  font-size: 0.6rem;
  opacity: 0.6;
}

/* Center the dropdown menu under the centered selector */
#headerScriptDropdown {
  transform: translateX(-50%);
  left: 50% !important;
}

.dropdown-item.script-option:hover {
  background-color: #e9ecef;
  transform: translateX(4px);
  transition: all 0.15s ease;
}

.dropdown-menu {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  max-height: 300px;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .prompter-text {
    font-size: 2.5rem;
  }
  .mic-btn {
    width: 100px;
    height: 100px;
    font-size: 48px;
  }
  .help-btn {
    width: 100px;
    height: 100px;
    font-size: 48px;
  }
  .mic-badge {
    font-size: 20px;
  }
}