/* ══════════════════════════════════════════════════════
   tedacs Streamer Portal — Custom Styles
   Cozy, warm, personal aesthetic derived from image_0.png
   ══════════════════════════════════════════════════════ */

/* ── Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  background-color: #FBF9F6;
  color: #4A403A;
  font-family: 'Lora', Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

/* Subtle warm texture overlay on the whole page */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse at 80% 0%, rgba(232,151,58,0.07) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 100%, rgba(196,98,45,0.06) 0%, transparent 55%);
  z-index: 0;
}

/* ── Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #F0EAD6; }
::-webkit-scrollbar-thumb { background: #D4B896; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #C4622D; }

/* ── Typography ───────────────────────────────────── */
h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.2;
}

/* ── Cards ────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(74,64,58,0.09), 0 1px 3px rgba(74,64,58,0.06);
  transition: box-shadow 0.25s ease, transform 0.2s ease;
}
.card:hover {
  box-shadow: 0 8px 36px rgba(74,64,58,0.14), 0 2px 6px rgba(74,64,58,0.08);
  transform: translateY(-1px);
}

/* ── Profile Visual ───────────────────────────────── */
.profile-visual-card {
  background: linear-gradient(160deg, #2a1a12 0%, #1a0f0a 100%);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 12px 48px rgba(196,98,45,0.25), 0 2px 8px rgba(0,0,0,0.2);
}

.profile-visual-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 60% 30%, rgba(196,98,45,0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(232,151,58,0.12) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

.profile-visual-card img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  filter: drop-shadow(0 8px 24px rgba(196,98,45,0.3));
}

/* ── Glow badge ───────────────────────────────────── */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(90deg, #C4622D, #E8973A);
  color: #fff;
  font-family: 'Lora', serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 99px;
  box-shadow: 0 0 12px rgba(232,151,58,0.5);
}
.live-dot {
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

/* ── Nav ──────────────────────────────────────────── */
.nav-link {
  font-family: 'Lora', serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #7C6B62;
  padding: 7px 16px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1.5px solid transparent;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.nav-link:hover {
  color: #C4622D;
  background: rgba(196,98,45,0.07);
}
.nav-link.active {
  color: #C4622D;
  background: rgba(196,98,45,0.10);
  border-color: rgba(196,98,45,0.2);
}

/* ── Buttons ──────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #C4622D 0%, #E8973A 100%);
  color: #fff;
  font-family: 'Lora', serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 10px;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 16px rgba(196,98,45,0.30);
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(196,98,45,0.45);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #F0EAD6;
  color: #4A403A;
  font-family: 'Lora', serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  border: 1.5px solid #D4B896;
  transition: all 0.2s ease;
}
.btn-secondary:hover {
  background: #e8dfc9;
  border-color: #C4622D;
  color: #C4622D;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: #b45a5a;
  font-family: 'Lora', serif;
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  border: 1.5px solid #e8b4b4;
  transition: all 0.2s ease;
}
.btn-danger:hover {
  background: #fdf0f0;
  border-color: #b45a5a;
}

/* ── Upload Zone ──────────────────────────────────── */
.upload-zone {
  border: 2.5px dashed #D4B896;
  border-radius: 16px;
  background: #FBF9F6;
  transition: all 0.25s ease;
  cursor: pointer;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: #C4622D;
  background: rgba(196,98,45,0.04);
  box-shadow: 0 0 0 4px rgba(196,98,45,0.08);
}

/* ── Overlay card thumbnail ───────────────────────── */
.overlay-thumb {
  background: #1a1410;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
}
.overlay-thumb img,
.overlay-thumb video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ── Copy badge ───────────────────────────────────── */
.copy-badge {
  font-size: 0.7rem;
  background: #F0EAD6;
  border: 1px solid #D4B896;
  color: #7C6B62;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Lora', serif;
  transition: all 0.2s;
  white-space: nowrap;
}
.copy-badge:hover {
  background: #C4622D;
  color: #fff;
  border-color: #C4622D;
}
.copy-badge.copied {
  background: #6aaf7a;
  color: #fff;
  border-color: #6aaf7a;
}

/* ── URL display ──────────────────────────────────── */
.url-box {
  background: #F0EAD6;
  border: 1.5px solid #D4B896;
  border-radius: 8px;
  padding: 8px 12px;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: #4A403A;
  word-break: break-all;
}

/* ══════════════════════════════════════════════════
   SCENE BUILDER
   ══════════════════════════════════════════════════ */

/* 16:9 canvas wrapper — max 1920×1080 (never exceeds logical resolution) */
.scene-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 1920px;
  max-height: 1080px;
  aspect-ratio: 16 / 9;
  background: #0f0c0a;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 64px rgba(0,0,0,0.4), 0 0 0 2px rgba(196,98,45,0.2);
}

/* Grid overlay on canvas */
.scene-canvas-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 0;
}

/* Elements dragged onto the canvas */
.scene-element {
  position: absolute;
  cursor: grab;
  user-select: none;
  border-radius: 4px;
  border: 1.5px solid rgba(232,151,58,0.0);
  transition: border-color 0.15s, box-shadow 0.15s;
  z-index: 10;
}
.scene-element:hover {
  border-color: rgba(232,151,58,0.6);
  box-shadow: 0 0 0 2px rgba(232,151,58,0.2);
}
.scene-element.gsap-dragging {
  cursor: grabbing !important;
  border-color: #E8973A;
  box-shadow: 0 0 0 3px rgba(232,151,58,0.35), 0 8px 24px rgba(0,0,0,0.4);
  z-index: 999 !important;
}

/* Sidebar draggable palette items */
.palette-item {
  background: #2a2220;
  border: 1.5px solid rgba(212,184,150,0.15);
  border-radius: 8px;
  cursor: grab;
  overflow: hidden;
  transition: all 0.2s;
  position: relative;
}
.palette-item:hover {
  border-color: rgba(232,151,58,0.5);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transform: scale(1.02);
}
.palette-item-label {
  font-family: 'Lora', serif;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.7);
  padding: 5px 8px;
  background: rgba(0,0,0,0.4);
  text-align: center;
}

/* Scene controls toolbar */
.scene-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Z-index control buttons on placed items */
.z-btn {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  font-family: 'Lora', serif;
  transition: all 0.15s;
}
.z-btn:hover {
  background: rgba(232,151,58,0.7);
  color: #fff;
}

/* Element label badge */
.element-badge {
  position: absolute;
  top: 3px;
  left: 3px;
  background: rgba(0,0,0,0.6);
  color: rgba(255,255,255,0.85);
  font-family: 'Lora', serif;
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}
.element-controls {
  position: absolute;
  bottom: 3px;
  right: 3px;
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.15s;
}
.scene-element:hover .element-controls { opacity: 1; }

/* ── Stats bar ────────────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 22px;
  box-shadow: 0 2px 16px rgba(74,64,58,0.08);
  border-left: 3px solid #C4622D;
}

/* ── Checklist ────────────────────────────────────── */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.8rem;
  color: #7C6B62;
  border-bottom: 1px solid rgba(212,184,150,0.3);
}
.checklist-item:last-child { border-bottom: none; }
.check-icon {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(106,175,122,0.15);
  border: 1.5px solid rgba(106,175,122,0.5);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Sidebar ──────────────────────────────────────── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #1e1612 0%, #150f0c 100%);
  border-radius: 12px;
  padding: 14px;
  overflow-y: auto;
  max-height: 600px;
}

/* ── Fade-in animation ────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.4s ease forwards; }

/* ── Tab panel ────────────────────────────────────── */
.tab-panel { animation: fadeUp 0.3s ease; }

/* ── Input ────────────────────────────────────────── */
input[type="text"], input[type="file"] {
  font-family: 'Lora', serif;
}
.cozy-input {
  width: 100%;
  background: #FBF9F6;
  border: 1.5px solid #D4B896;
  border-radius: 9px;
  padding: 9px 14px;
  font-family: 'Lora', serif;
  font-size: 0.85rem;
  color: #4A403A;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cozy-input:focus {
  border-color: #C4622D;
  box-shadow: 0 0 0 3px rgba(196,98,45,0.12);
}

/* ── Toast notification ───────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: linear-gradient(135deg, #C4622D, #E8973A);
  color: #fff;
  font-family: 'Lora', serif;
  font-size: 0.82rem;
  padding: 12px 22px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(196,98,45,0.35);
  z-index: 9999;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.2s forwards;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}

/* ══════════════════════════════════════════════════
   SCENE BUILDER — RESIZE HANDLES
   ══════════════════════════════════════════════════ */

/* The 8 resize handle squares on a selected layer */
.resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #E8973A;
  border: 2px solid #fff;
  border-radius: 2px;
  z-index: 1000;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  transition: transform 0.1s, background 0.1s;
}
.resize-handle:hover {
  background: #fff;
  transform: scale(1.3);
}

/* Position each handle */
.rh-n  { top: -5px;  left: 50%; transform: translateX(-50%); cursor: n-resize; }
.rh-ne { top: -5px;  right: -5px; cursor: ne-resize; }
.rh-e  { top: 50%;  right: -5px; transform: translateY(-50%); cursor: e-resize; }
.rh-se { bottom: -5px; right: -5px; cursor: se-resize; }
.rh-s  { bottom: -5px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.rh-sw { bottom: -5px; left: -5px; cursor: sw-resize; }
.rh-w  { top: 50%;  left: -5px; transform: translateY(-50%); cursor: w-resize; }
.rh-nw { top: -5px;  left: -5px; cursor: nw-resize; }

/* Hover override — don't apply translateX/Y on top of the above */
.rh-n:hover  { transform: translateX(-50%) scale(1.3); }
.rh-e:hover  { transform: translateY(-50%) scale(1.3); }
.rh-s:hover  { transform: translateX(-50%) scale(1.3); }
.rh-w:hover  { transform: translateY(-50%) scale(1.3); }

/* ══════════════════════════════════════════════════
   SCENE BUILDER — RIGHT PANEL
   ══════════════════════════════════════════════════ */

.sb-right-panel {
  width: 240px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #1e1612 0%, #150f0c 100%);
  border-radius: 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(212,184,150,0.12);
}

.sb-panel-section {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(212,184,150,0.1);
}
.sb-panel-section:last-child { border-bottom: none; }

.sb-panel-label {
  font-family: 'Lora', serif;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.35);
  margin-bottom: 8px;
}

/* Layer list rows in the right panel */
.sb-layer-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
  margin-bottom: 3px;
}
.sb-layer-row:hover {
  background: rgba(255,255,255,0.05);
}
.sb-layer-row.selected {
  background: rgba(232,151,58,0.18);
  border: 1px solid rgba(232,151,58,0.3);
}
.sb-layer-name {
  flex: 1;
  font-family: 'Lora', serif;
  font-size: 0.73rem;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-layer-z {
  font-family: 'Lora', serif;
  font-size: 0.62rem;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}

/* OBS URL box in the right panel */
.sb-obs-url-box {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(196,98,45,0.3);
  border-radius: 7px;
  padding: 7px 10px;
  font-family: 'Courier New', monospace;
  font-size: 0.62rem;
  color: rgba(255,255,255,0.65);
  word-break: break-all;
  margin-bottom: 8px;
}

/* Scene name input (dark variant for the builder) */
.sb-name-input {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(212,184,150,0.2);
  border-radius: 7px;
  padding: 7px 10px;
  font-family: 'Lora', serif;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.85);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 8px;
}
.sb-name-input:focus {
  border-color: #E8973A;
  box-shadow: 0 0 0 3px rgba(232,151,58,0.15);
}
.sb-name-input::placeholder { color: rgba(255,255,255,0.3); }

/* Scenes list items */
.sb-scene-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 7px;
  margin-bottom: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(212,184,150,0.08);
  transition: all 0.15s;
}
.sb-scene-item:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(196,98,45,0.25);
}
.sb-scene-item.active {
  background: rgba(196,98,45,0.15);
  border-color: rgba(196,98,45,0.4);
}
.sb-scene-name {
  flex: 1;
  font-family: 'Lora', serif;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dark button variants for the builder */
.btn-dark {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  font-family: 'Lora', serif;
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.12);
  transition: all 0.15s;
}
.btn-dark:hover {
  background: rgba(232,151,58,0.25);
  color: #E8973A;
  border-color: rgba(232,151,58,0.4);
}
.btn-dark-danger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  color: rgba(220,100,100,0.7);
  font-family: 'Lora', serif;
  font-size: 0.72rem;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(220,100,100,0.25);
  transition: all 0.15s;
}
.btn-dark-danger:hover {
  background: rgba(220,100,100,0.12);
  color: #e07070;
  border-color: rgba(220,100,100,0.5);
}
.btn-accent {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #C4622D, #E8973A);
  color: #fff;
  font-family: 'Lora', serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  border: none;
  box-shadow: 0 3px 12px rgba(196,98,45,0.35);
  transition: all 0.15s;
  width: 100%;
  justify-content: center;
}
.btn-accent:hover {
  box-shadow: 0 5px 18px rgba(196,98,45,0.5);
  transform: translateY(-1px);
}
.btn-accent:active { transform: translateY(0); }
.btn-accent:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Drop target overlay on the canvas when dragging from sidebar */
.canvas-drop-active::before {
  content: 'Drop to add layer';
  position: absolute;
  inset: 0;
  background: rgba(232,151,58,0.08);
  border: 3px dashed rgba(232,151,58,0.5);
  border-radius: 12px;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Lora', serif;
  font-size: 1rem;
  color: rgba(232,151,58,0.7);
  pointer-events: none;
}

/* Selected layer highlight */
.scene-element.selected {
  border-color: #E8973A !important;
  box-shadow: 0 0 0 2px rgba(232,151,58,0.5), 0 8px 24px rgba(0,0,0,0.5) !important;
}

/* ── Dropdown Menu ────────────────────────────────── */
.nav-dropdown-container {
  position: relative;
  display: inline-block;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: rgba(251, 249, 246, 0.98);
  border: 1px solid rgba(212, 184, 150, 0.35);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(74, 64, 58, 0.12);
  padding: 6px 0;
  min-width: 180px;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.2s ease;
}

.nav-dropdown-container:hover .nav-dropdown-menu,
.nav-dropdown-container:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  padding: 8px 16px;
  color: #7C6B62;
  text-decoration: none;
  font-size: 0.82rem;
  font-family: 'Lora', serif;
  transition: background 0.15s, color 0.15s;
}

.dropdown-item:hover {
  background: rgba(196, 98, 45, 0.07);
  color: #C4622D;
}
