/* ═══════════════════════════════════════════════════════════════════
   SKLUBS CARD EDITOR — MAIN STYLESHEET
   Design System: Orange #FF6B00 / Black #0A0A0A / White #F5F5F5
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Barlow+Condensed:wght@500;600;700;800;900&display=swap');

/* ─── DESIGN TOKENS ──────────────────────────────────────────────── */
:root {
  /* Brand Colors */
  --orange:        #FF6B00;
  --orange-light:  #FF8C33;
  --orange-dark:   #D45500;
  --orange-glow:   rgba(255, 107, 0, 0.25);
  --orange-subtle: rgba(255, 107, 0, 0.08);

  /* Neutral Scale */
  --black:     #0A0A0A;
  --grey-950:  #111111;
  --grey-900:  #161616;
  --grey-800:  #1E1E1E;
  --grey-700:  #2A2A2A;
  --grey-600:  #3A3A3A;
  --grey-500:  #555555;
  --grey-400:  #888888;
  --grey-300:  #AAAAAA;
  --grey-200:  #CCCCCC;
  --grey-100:  #E8E8E8;
  --white:     #F5F5F5;
  --pure-white: #FFFFFF;

  /* Semantic */
  --bg:         var(--black);
  --surface:    var(--grey-900);
  --surface-2:  var(--grey-800);
  --surface-3:  var(--grey-700);
  --border:     var(--grey-700);
  --border-light: rgba(255,255,255,0.08);
  --text:       var(--white);
  --text-muted: var(--grey-300);
  --text-dim:   var(--grey-500);
  --accent:     var(--orange);

  /* Success / Warning / Error */
  --success: #22C55E;
  --warning: #F59E0B;
  --error:   #EF4444;

  /* Typography */
  --font-body:    'Inter', system-ui, sans-serif;
  --font-display: 'Barlow Condensed', sans-serif;

  /* Spacing Scale */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* Border Radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.5);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-xl:  0 16px 64px rgba(0,0,0,0.7);
  --shadow-orange: 0 4px 24px var(--orange-glow);
  --shadow-orange-lg: 0 8px 48px rgba(255,107,0,0.35);

  /* Transitions */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
  --duration-fast:   150ms;
  --duration-normal: 250ms;
  --duration-slow:   400ms;

  /* Layout */
  --sidebar-width:    280px;
  --panel-width:      320px;
  --topbar-height:    60px;
  --canvas-min-height: calc(100vh - var(--topbar-height));
}

/* ─── CSS RESET ──────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* ─── TYPOGRAPHY ─────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: var(--text);
}

.text-xs    { font-size: 11px; }
.text-sm    { font-size: 13px; }
.text-base  { font-size: 15px; }
.text-lg    { font-size: 18px; }
.text-xl    { font-size: 22px; }
.text-2xl   { font-size: 28px; }
.text-3xl   { font-size: 36px; }

.text-orange { color: var(--orange); }
.text-muted  { color: var(--text-muted); }
.text-dim    { color: var(--text-dim); }

.font-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ─── GLASS SURFACES ─────────────────────────────────────────────── */
.glass {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--border-light);
}

.glass-dark {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.glass-orange {
  background: rgba(255, 107, 0, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 107, 0, 0.2);
}

/* ─── BUTTON SYSTEM ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-5);
  height: 38px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  border: none;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--duration-fast) ease;
}

.btn:hover::before { opacity: 1; }

.btn-primary {
  background: var(--orange);
  color: #fff;
  box-shadow: var(--shadow-orange);
}

.btn-primary:hover {
  background: var(--orange-light);
  box-shadow: var(--shadow-orange-lg);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--grey-500);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  font-size: 16px;
}

.btn-icon:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--grey-500);
}

.btn-icon.active {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
  box-shadow: var(--shadow-orange);
}

.btn-sm { height: 30px; padding: 0 var(--space-3); font-size: 12px; }
.btn-lg { height: 46px; padding: 0 var(--space-8); font-size: 15px; }

/* ─── BADGE / TAG ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badge-orange { background: var(--orange-subtle); color: var(--orange); border: 1px solid rgba(255,107,0,0.2); }
.badge-green  { background: rgba(34,197,94,0.08);  color: var(--success); border: 1px solid rgba(34,197,94,0.2); }
.badge-grey   { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

/* ─── FORM CONTROLS ──────────────────────────────────────────────── */
.input, select, textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease;
  appearance: none;
}

.input:focus, select:focus, textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px var(--orange-glow);
}

.input::placeholder { color: var(--text-dim); }

/* Custom Select Arrow */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}

/* Color Input */
input[type="color"] {
  width: 36px;
  height: 36px;
  padding: 2px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  outline: none;
  width: 100%;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--orange);
  border: 2px solid #fff;
  box-shadow: var(--shadow-orange);
  cursor: pointer;
  transition: transform var(--duration-fast) ease;
}

input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* Checkbox & Radio */
.checkbox, .radio-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  user-select: none;
}

.checkbox input[type="checkbox"],
.radio-btn input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--orange);
  cursor: pointer;
}

/* ─── DIVIDER ────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-4) 0;
}

/* ─── SCROLLBAR ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--grey-700);
  border-radius: var(--radius-full);
  transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover { background: var(--grey-500); }

/* ─── UTILITY CLASSES ────────────────────────────────────────────── */
.flex           { display: flex; }
.flex-col       { flex-direction: column; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between{ justify-content: space-between; }
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }

.w-full   { width: 100%; }
.h-full   { height: 100%; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* ─── TOOLTIP ────────────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--grey-900);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all var(--duration-fast) ease;
  border: 1px solid var(--border);
  z-index: 9999;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── ANIMATIONS ─────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-orange {
  0%, 100% { box-shadow: 0 0 0 0 var(--orange-glow); }
  50%       { box-shadow: 0 0 0 8px transparent; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-fade-in  { animation: fadeIn 0.3s var(--ease-out) forwards; }
.animate-slide-in { animation: slideIn 0.25s var(--ease-out) forwards; }
.animate-spin     { animation: spin 1s linear infinite; }

/* ─── NOTIFICATION TOAST ─────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 600;
  min-width: 260px;
  animation: fadeIn 0.25s var(--ease-out) forwards;
  box-shadow: var(--shadow-lg);
}

.toast-success { background: #14532d; border: 1px solid rgba(34,197,94,0.3); color: #86efac; }
.toast-error   { background: #450a0a; border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.toast-info    { background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); }
.toast-orange  { background: rgba(255,107,0,0.12); border: 1px solid rgba(255,107,0,0.3); color: var(--orange); }

/* ─── MODAL ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  width: min(90vw, 560px);
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(8px);
  transition: transform var(--duration-normal) var(--ease-spring);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body    { padding: var(--space-6); }
.modal-footer  { padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border); display: flex; gap: var(--space-3); justify-content: flex-end; }

/* ─── LOADING STATES ─────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
