/* embed.css — Premium Dark Theme for Widget Embed Generator Dashboard */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --gold: #f59e0b;
  --gold-light: #fcd34d;
  --gold-dark: #d97706;
  --blue: #3b82f6;
  --bg: #0a0b0f;
  --bg-panel: rgba(255, 255, 255, 0.03);
  --bg-panel-hover: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(245, 158, 11, 0.3);
  --text: #f1f5f9;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* Skip link accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--gold);
  color: #000000;
  padding: 8px 16px;
  z-index: 1000;
  transition: top 0.2s;
  font-weight: 700;
  text-decoration: none;
  border-bottom-right-radius: var(--radius-xs);
}

.skip-link:focus {
  top: 0;
}

/* ── Animated Background ── */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.08;
  animation: floatOrb 25s ease-in-out infinite;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--gold), transparent 70%);
  top: -200px;
  right: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #8b5cf6, transparent 70%);
  bottom: -150px;
  left: -100px;
  animation-delay: -7s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #ef4444, transparent 70%);
  top: 40%;
  left: 30%;
  animation-delay: -14s;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -40px) scale(1.06); }
  66% { transform: translate(-30px, 30px) scale(0.94); }
}

/* ── Header ── */
.header {
  background-color: rgba(10, 11, 15, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-size: 20px;
  color: #ffffff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.header-pcso-logo {
  height: 36px;
  width: auto;
}

.header-actions {
  display: flex;
  gap: 12px;
}

.history-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: rgba(255, 255, 255, 0.02);
  transition: all 0.2s;
  font-size: 13px;
}

.history-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--text-muted);
}

/* ── Main Layout ── */
.main-container {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 24px;
  flex-grow: 1;
  position: relative;
  z-index: 1;
}

.intro-section {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 40px auto;
}

.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 30%, var(--gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-subtitle {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.6;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}

@media (min-width: 960px) {
  .dashboard-layout {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

/* Panel Containers */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color 0.3s;
}

.panel:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.panel-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  color: #ffffff;
}

/* Column Group for Preview + Code */
.preview-and-code-column {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ── Form Controls & Inputs ── */
.form-group {
  margin-bottom: 24px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-row {
  display: flex;
  gap: 16px;
}

.flex-1 {
  flex: 1;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.label-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.label-header .form-label {
  margin-bottom: 0;
}

.quick-select-actions {
  font-size: 11px;
}

.quick-select-actions button {
  background: none;
  border: none;
  color: var(--blue);
  cursor: pointer;
  font-weight: 600;
}

.quick-select-actions button:hover {
  text-decoration: underline;
}

.dot-separator {
  color: var(--text-muted);
  margin: 0 4px;
}

/* Form Inputs */
input[type="text"] {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #ffffff;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

/* Theme Picker */
.theme-picker {
  display: flex;
  gap: 12px;
}

.theme-option {
  flex: 1;
  cursor: pointer;
}

.theme-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-badge {
  display: block;
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.dark-badge {
  background-color: #12131a;
  color: #ffffff;
}

.light-badge {
  background-color: #f8fafc;
  color: #0f172a;
}

.theme-option input:checked + .theme-badge {
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
}

/* Toggle Switch */
.toggle-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  width: 38px;
  height: 20px;
  background-color: #27272a;
  border-radius: 20px;
  position: relative;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  bottom: 3px;
  background-color: #a1a1aa;
  border-radius: 50%;
  transition: transform 0.2s, background-color 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--blue);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background-color: #ffffff;
}

.toggle-label {
  margin-left: 10px;
  font-size: 13px;
  color: var(--text-dim);
}

/* Games Grid */
.games-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  user-select: none;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkbox-checkmark {
  height: 16px;
  width: 16px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkbox-checkmark {
  border-color: var(--text-muted);
}

.checkbox-container input:checked ~ .checkbox-checkmark {
  background-color: var(--gold);
  border-color: var(--gold);
}

.checkbox-checkmark::after {
  content: "";
  display: none;
  width: 4px;
  height: 8px;
  border: solid #000000;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.checkbox-container input:checked ~ .checkbox-checkmark::after {
  display: block;
}

/* Presets */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.preset-btn {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  padding: 10px 8px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-btn strong {
  font-size: 12px;
  color: #ffffff;
}

.preset-btn:hover {
  background: rgba(255,255,255,0.03);
  border-color: var(--text-muted);
}

.preset-btn.active {
  border-color: var(--gold);
  background: rgba(245,158,11,0.05);
  color: #ffffff;
}

/* ── Preview Area ── */
.preview-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
}

.preview-device {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  background: #000000;
  overflow: hidden;
  display: flex;
}

/* ── Code Snippet Area ── */
.code-instructions {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.code-block-container {
  position: relative;
  background: #050608;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  padding-right: 120px;
  overflow-x: auto;
  min-height: 56px;
  display: flex;
  align-items: center;
}

#embed-code-block {
  font-family: 'Space Mono', Courier, monospace;
  font-size: 12px;
  color: #38bdf8; /* Blue code highlighting */
  white-space: pre-wrap;
  word-break: break-all;
}

.copy-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--gold);
  color: #000000;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.copy-btn:hover {
  background-color: var(--gold-light);
  transform: translateY(-50%) scale(1.02);
}

.copy-btn:active {
  transform: translateY(-50%) scale(0.98);
}

/* ── Footer ── */
.footer {
  background-color: rgba(10, 11, 15, 0.95);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  margin-top: 60px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-nav {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.footer-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.footer-link:hover {
  color: #ffffff;
}

.footer-sep {
  color: var(--text-muted);
}

.footer-note {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 12px auto;
  line-height: 1.5;
}

.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
}
