/* app.css - shared styles */

:root {
  --bg-main: #05050a;
  --bg-card: #151520;
  --bg-panel: #141421;
  --border-subtle: #333649;
  --accent: #9b6dff;
  --accent-soft: #433878;
  --text-main: #f5f5f5;
  --text-muted: #a0a3b8;
  --danger: #e24a63;
  --success: #1fbf75;
  --info: #3879f6;
}


body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #111427 0, #05050a 55%);
  color: var(--text-main);
}

/* Layout helpers */

body.landing,
body.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

body.dashboard {
  background: radial-gradient(circle at top, #111427 0, #05050a 55%);
  padding: 16px 24px 32px;
}

.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}

.card-center {
  max-width: 460px;
  width: 100%;
}

.card h1,
.card h2 {
  margin-top: 0;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.1s ease, opacity 0.1s ease;
  white-space: nowrap;
}

.button.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(155, 109, 255, 0.5);
}

.button.secondary {
  background: #26263a;
  color: var(--text-main);
}

.button.small {
  padding: 6px 14px;
  font-size: 13px;
}

.button.fullwidth {
  width: 100%;
}

.button.disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

.button:hover:not(.disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}

.button:active:not(.disabled) {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

/* Inputs & forms */

.form label {
  display: block;
  margin-top: 12px;
  font-size: 13px;
}

.form input[type="text"], 
.form input[type="email"], 
.form input[type="password"], 
.form input[type="number"]{
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: #0e101a;
  color: var(--text-main);
  font-size: 14px;
}

.form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(155, 109, 255, 0.6);
}

/* Alerts */

.alert {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
}

.alert ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.alert-error {
  background: rgba(226, 74, 99, 0.12);
  border: 1px solid rgba(226, 74, 99, 0.6);
}

.alert-success {
  background: rgba(31, 191, 117, 0.12);
  border: 1px solid rgba(31, 191, 117, 0.6);
}

.alert-info {
  background: rgba(56, 121, 246, 0.12);
  border: 1px solid rgba(56, 121, 246, 0.6);
}

/* Misc text */

.muted {
  color: var(--text-muted);
  font-size: 13px;
}

/* Divider */

.divider {
  display: flex;
  align-items: center;
  margin: 18px 0 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #26263a;
}

.divider span {
  padding: 0 8px;
}

/* Social buttons */

.social-login .button.social {
  justify-content: center;
  margin-top: 8px;
}

.button.social.google {
  background: #ffffff;
  color: #202124;
}

.button.social.discord {
  background: #5865f2;
  color: #ffffff;
}

/* Header & dashboard */

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

.main-header .tag {
  margin-left: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: #27273a;
  font-size: 11px;
  color: var(--text-muted);
}

.tag.success {
  background: rgba(31, 191, 117, 0.16);
  color: #a0f5cd;
}

.page-content {
  max-width: 900px;
  margin: 0 auto;
}

.panel {
  background: var(--bg-panel);
  border-radius: 16px;
  padding: 18px 18px 22px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
}

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

.panel-header h1 {
  font-size: 20px;
  margin: 0;
}

/* List items */

.card.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.list-main {
  flex: 1;
  min-width: 0;
  padding-right: 12px;
}

.list-title {
  font-size: 15px;
  font-weight: 600;
}

.list-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  word-break: break-all;
}

.list-actions {
  display: flex;
  gap: 8px;
}

/* Overlay placeholder */

body.overlay {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* === Overlay editor layout === */

body.editor {
  background: radial-gradient(circle at top, #111427 0, #05050a 55%);
  padding: 16px 24px 32px;
}

.editor-layout {
  display: grid;
  grid-template-columns: 900px 400px;
  gap: 16px;
  align-items: flex-start;
}

.editor-preview {
  min-height: 400px;
  /* width: 900px; */
  /* height: 800px; */
}

.editor-controls {
  min-height: 400px;
}

/* Overlay root */

.overlay-root {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.0);
  overflow: visible;
  transform-origin: center center;
}

.overlay-root.preview-mode {
  background: radial-gradient(circle at top, #14192c 0, #05050a 50%);
}

.overlay-root.live-mode {
  background: transparent;
}

/* Base plate */

.overlay-plate {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60%;
  height: 60%;
  transform: translate(-50%, -50%);
  border-radius: 50px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.6));
}

/* Buttons */

.overlay-button {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
  opacity: 0.5;
  transition: transform 0.06s ease, opacity 0.06s ease, box-shadow 0.06s ease;
}

.overlay-button.is-pressed {
  opacity: 1;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.9);
}

/* D-pad */

.overlay-dpad {
  position: absolute;
  border-radius: 4px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.7);
  opacity: 0.5;
  transition: transform 0.06s ease, opacity 0.06s ease, box-shadow 0.06s ease;
}

.overlay-dpad.is-pressed {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.9);
}
/* Bumpers (LB / RB) */

.overlay-bumper {
  position: absolute;
  border-radius: 999px;
  background: rgba(200, 200, 200, 0.85);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.9);
  opacity: 0.6;
  transform: scale(0.98);
  transition:
    transform 0.07s ease,
    opacity 0.07s ease,
    box-shadow 0.07s ease,
    filter 0.07s ease;
}

.overlay-bumper.is-pressed {
  opacity: 1;
  transform: translateY(-1px) scale(1.1);
  box-shadow:
    0 0 14px rgba(255, 255, 255, 0.9),
    0 8px 20px rgba(0, 0, 0, 1);
  filter: brightness(1.2);
}

/* Sticks */

.overlay-stick {
  position: absolute;
  border-radius: 50%;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
}

.overlay-stick-nub {
  width: 60%;
  height: 60%;
  border-radius: 50%;
  background: radial-gradient(circle at top, #44495a, #151722);
  transition: transform 0.05s linear;
}

/* Triggers */

.overlay-trigger {
  position: absolute;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.8);
}

.overlay-trigger-fill {
  height: 100%;
  width: 0%;
  background: var(--trigger-color, #888888);
  transition: width 0.04s linear;
}

/* OBS overlay body */

body.overlay {
  margin: 0;
  padding: 0;
  background: transparent !important;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}



/* Fallback when no overlay config */

.overlay-fallback {
  max-width: 460px;
  margin: 40px auto;
}

.settings-section {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 6px 8px 8px;
  margin-bottom: 10px;
}

.settings-section > summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.settings-section[open] > summary {
  margin-bottom: 6px;
}

.settings-section > summary::marker {
  content: "";
}

.row-inline {
  display: flex;
  gap: 6px;
  align-items: center;
}

.form-row.inline > div {
  flex: 1;
}
.overlay-body{background: transparent;}



/* Save status indicator in editor */
#save-status {
  font-size: 12px;
  margin-top: 4px;
  min-height: 16px;
  color: var(--text-muted);
}

#save-status.status-ok {
  color: var(--success);
}

#save-status.status-error {
  color: var(--danger);
}

#save-status.status-dirty {
  color: var(--info);
}
/* Editor active controller note */
.editor-active-note {
  font-size: 11px;
  margin-top: 4px;
  color: var(--text-muted);
}
/* Shared pagination styles */
.dashboard-pagination,
.gallery-pagination {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.6);
  font-size: 0.85rem;
  text-decoration: none;
  color: #e5e7eb;
  background: rgba(15,23,42,0.95);
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.05s ease;
}

.page-link:hover {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #f9fafb;
  transform: translateY(-1px);
}

.page-link.active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #f9fafb;
  font-weight: 600;
}
