/* ─── Design tokens ───────────────────────────────────── */
:root {
  --c-bg:        #07070f;
  --c-surface:   #0c0c18;
  --c-surface-2: #11111f;
  --c-border:    rgba(255,255,255,0.07);
  --c-border-2:  rgba(255,255,255,0.11);
  --c-text:      #eeeef8;
  --c-muted:     #6b7280;
  --c-muted-2:   #9ca3af;
  --c-accent:    #6366f1;
  --c-accent-2:  #818cf8;
}

/* ─── Bootstrap 5.3 dark-mode token overrides ──────────── */
[data-bs-theme="dark"] {
  --bs-body-bg:                   var(--c-bg);
  --bs-body-bg-rgb:               7, 7, 15;
  --bs-body-color:                var(--c-text);
  --bs-body-color-rgb:            238, 238, 248;
  --bs-secondary-color:           var(--c-muted-2);
  --bs-secondary-color-rgb:       156, 163, 175;
  --bs-tertiary-color:            var(--c-muted);
  --bs-border-color:              rgba(255,255,255,0.09);
  --bs-border-color-translucent:  rgba(255,255,255,0.08);
  --bs-secondary-bg:              var(--c-surface);
  --bs-tertiary-bg:               var(--c-surface-2);
  --bs-emphasis-color:            #fff;
  --bs-primary-rgb:               99, 102, 241;
  --bs-link-color:                #818cf8;
  --bs-link-hover-color:          #a5b4fc;
  --bs-code-color:                #c4b5fd;
}

/* ─── Base ──────────────────────────────────────────────── */
html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

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

body {
  margin: 0;
  background-color: var(--c-bg);
  color: var(--c-text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Top bar ───────────────────────────────────────────────── */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 1040;
  background: rgba(7,7,15,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.top-bar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--c-muted-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.top-bar-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--c-text);
}

.top-bar-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 0 8px;
  gap: 8px;
}

/* ─── App shell ─────────────────────────────────────────────── */
html, body {
  height: 100%;
  overflow: hidden;
}

.app-main {
  padding-top: 44px;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* ─── Off-canvas dark ───────────────────────────────────────── */
.offcanvas-dark {
  background: var(--c-surface);
  border-color: var(--c-border-2);
}

.offcanvas-dark .offcanvas-header {
  border-bottom: 1px solid var(--c-border);
  padding: 14px 16px;
}

.offcanvas-dark .offcanvas-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--c-text);
}

/* ─── Editor shell (no-scroll, fills height) ────────────────── */
.editor-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.editor-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.editor-studio {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ─── Gallery panel ─────────────────────────────────────────── */
.gallery-folders {
  padding: 10px 8px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gallery-folder-link {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: .8rem;
  color: var(--c-muted-2);
  text-decoration: none;
  transition: background .12s, color .12s;
}
.gallery-folder-link:hover {
  background: rgba(255,255,255,0.06);
  color: var(--c-text);
}

.gallery-shot-list {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 2px;
}

.gallery-shot-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  transition: background .12s;
}
.gallery-shot-item:hover {
  background: rgba(255,255,255,0.06);
}

.gallery-shot-thumb {
  width: 44px;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-shot-info {
  flex: 1;
  min-width: 0;
}

.gallery-shot-name {
  font-size: .82rem;
  font-weight: 500;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-shot-date {
  font-size: .72rem;
  color: var(--c-muted);
  margin-top: 1px;
}

.gallery-empty {
  padding: 32px 20px;
  text-align: center;
}

/* ─── Focus rings ───────────────────────────────────────── */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus,
.form-select:focus {
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25);
  outline: none;
}

/* ─── Form controls ─────────────────────────────────────── */
.form-control,
.form-select {
  background-color: rgba(255,255,255,0.05);
  border-color: var(--c-border-2);
  color: var(--c-text);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}

.form-control:hover,
.form-select:hover {
  border-color: rgba(255,255,255,0.18);
  background-color: rgba(255,255,255,0.07);
}

.form-control:focus,
.form-select:focus {
  background-color: rgba(255,255,255,0.07);
  border-color: var(--c-accent);
  color: var(--c-text);
}

.form-control::placeholder {
  color: var(--c-muted);
}

.form-select option {
  background-color: #1a1a2e;
  color: var(--c-text);
}

/* ─── Placeholders ──────────────────────────────────────── */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--c-muted);
  text-align: end;
}

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

/* ─── Buttons ───────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent;
  color: #fff;
  font-weight: 500;
  letter-spacing: .01em;
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #818cf8, #a78bfa);
  border-color: transparent;
  color: #fff;
}

.btn-primary:active {
  background: linear-gradient(135deg, #4f52d9, #7c3aed);
}

.btn-dark {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.11);
  color: var(--c-text);
}

.btn-dark:hover,
.btn-dark:focus {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.20);
  color: #fff;
}

.btn-dark.active,
.btn-dark:active {
  background: rgba(99,102,241,0.20) !important;
  border-color: rgba(99,102,241,0.40) !important;
  color: var(--c-accent-2) !important;
}

.btn-outline-secondary {
  border-color: rgba(255,255,255,0.11);
  color: var(--c-muted-2);
  background: transparent;
}

.btn-outline-secondary:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.20);
  color: var(--c-text);
}

.btn-secondary {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.14);
  color: var(--c-text);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.22);
  color: #fff;
}

/* ─── Alerts ────────────────────────────────────────────── */
.alert-success {
  background-color: rgba(22,163,74,0.12);
  border-color: rgba(22,163,74,0.25);
  color: #4ade80;
}

.alert-warning {
  background-color: rgba(234,179,8,0.10);
  border-color: rgba(234,179,8,0.22);
  color: #fde047;
}

/* ─── Sidebar panel (studio controls) ──────────────────── */
.studio-sidebar {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  padding: 20px;
}

.studio-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--c-muted);
  letter-spacing: .09em;
  margin-bottom: 8px;
}

.studio-hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 14px 0;
}

.studio-color-picker {
  width: 32px;
  height: 28px;
  padding: 2px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
}

/* ─── Range sliders ─────────────────────────────────────── */
input[type="range"] {
  accent-color: var(--c-accent);
}

/* ─── Form range ────────────────────────────────────────── */
.form-range::-webkit-slider-thumb {
  background: var(--c-accent);
}

.form-range::-webkit-slider-runnable-track {
  background: rgba(255,255,255,0.12);
}

/* ─── Code ──────────────────────────────────────────────── */
code {
  color: #c4b5fd;
  background: rgba(99,102,241,0.12);
  padding: .1em .35em;
  border-radius: 4px;
  font-size: .88em;
}

/* ─── Dashboard / management UI ────────────────────────── */
.page-title {
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #eeeef8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.back-link {
  font-size: .85rem;
  color: var(--c-muted-2);
  text-decoration: none;
}
.back-link:hover { color: var(--c-accent-2); }

.card-dark {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 20px;
  transition: border-color .15s;
}
.card-dark:hover { border-color: var(--c-border-2); }

.site-name {
  font-weight: 600;
  color: var(--c-text);
  text-decoration: none;
  font-size: 1rem;
}
.site-name:hover { color: var(--c-accent-2); }

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--c-muted-2);
  margin-top: .5rem;
}

.section-hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 1.25rem 0;
}

.section-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--c-muted);
  margin-bottom: .75rem;
}

.form-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  padding: 28px;
}

.form-label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--c-muted-2);
  margin-bottom: .35rem;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--c-border-2);
  color: var(--c-muted-2);
  font-size: .875rem;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.05);
  color: var(--c-text);
  border-color: rgba(255,255,255,0.2);
}

.badge-success {
  background: rgba(34,197,94,0.15);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.25);
  padding: .2em .55em;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 600;
}

.badge-danger {
  background: rgba(239,68,68,0.15);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.25);
  padding: .2em .55em;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 600;
}

.badge-scheduled {
  background: rgba(99,102,241,0.15);
  color: #818cf8;
  border: 1px solid rgba(99,102,241,0.25);
  padding: .2em .55em;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 600;
}

.badge-secondary {
  background: rgba(255,255,255,0.07);
  color: var(--c-muted-2);
  border: 1px solid var(--c-border);
  padding: .2em .55em;
  border-radius: 6px;
  font-size: .72rem;
}

.table-dark-wrapper {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  overflow: hidden;
}

.table-dark {
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--c-border);
  font-size: .85rem;
}

.table-dark thead th {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--c-muted);
  border-bottom-color: var(--c-border-2);
}

.empty-state {
  background: var(--c-surface);
  border: 1px dashed var(--c-border-2);
  border-radius: 16px;
  padding: 3rem;
}

