/* ─── Icey Clip AI — Global Design System ─────────────────────────────────── */

:root {
  --bg-base:         #080C14;
  --bg-surface:      #0E1420;
  --bg-elevated:     #141D2E;
  --bg-input:        #0B1020;
  --accent-cyan:     #06B6D4;
  --accent-sky:      #38BDF8;
  --accent-emerald:  #10B981;
  --accent-rose:     #F43F5E;
  --accent-blue:     #60A5FA;
  --accent-purple:   #A78BFA;
  --accent-yellow:   #F59E0B;
  --accent-orange:   #F97316;
  --text-primary:    #F1F5F9;
  --text-secondary:  #94A3B8;
  --text-muted:      #4B5A72;
  --border-color:    rgba(6,182,212,0.18);
  --border-subtle:   rgba(255,255,255,0.05);
  --font-ui:         'Inter', 'Roboto', sans-serif;
  --font-mono:       'JetBrains Mono', 'Fira Code', monospace;
  --radius-card:     14px;
  --radius-btn:      10px;
  --radius-sm:       8px;
  --glow-cyan:       0 0 20px rgba(6,182,212,0.35);
  --glow-emerald:    0 0 20px rgba(16,185,129,0.35);
  --glow-rose:       0 0 20px rgba(244,63,94,0.35);
  --shadow-card:     0 4px 32px rgba(0,0,0,0.5);
  --transition:      all 0.18s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-cyan); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-sky); }

img { max-width: 100%; display: block; }

/* ─── Layout ─────────────────────────────────────────────────────────────────── */

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.main-content {
  flex: 1;
  padding: 28px 32px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ─── Typography ─────────────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5 { font-weight: 600; line-height: 1.3; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

.font-mono { font-family: var(--font-mono) !important; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-cyan { color: var(--accent-cyan); }
.text-emerald { color: var(--accent-emerald); }
.text-rose { color: var(--accent-rose); }
.text-sky { color: var(--accent-sky); }
.text-blue { color: var(--accent-blue); }
.text-purple { color: var(--accent-purple); }
.text-yellow { color: var(--accent-yellow); }
.text-orange { color: var(--accent-orange); }
.text-slate { color: var(--text-muted); }

/* ─── Cards ──────────────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.card-sm { padding: 16px; }
.card-glow { border-color: var(--border-color); box-shadow: var(--glow-cyan), var(--shadow-card); }

/* ─── Buttons ────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-sky));
  color: #000;
  font-weight: 600;
}
.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: var(--glow-cyan);
  color: #000;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--bg-surface); border-color: var(--accent-cyan); color: var(--text-primary); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-color); }

.btn-danger {
  background: rgba(244,63,94,0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244,63,94,0.3);
}
.btn-danger:hover { background: var(--accent-rose); color: #fff; }

.btn-ghost-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-danger-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Inputs ─────────────────────────────────────────────────────────────────── */

.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 6px; font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  padding: 10px 14px;
  transition: var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6,182,212,0.1);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-select { cursor: pointer; }

/* ─── Badges / Status Tags ───────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-draft     { background: rgba(100,116,139,0.2); color: var(--text-secondary); }
.status-scheduled { background: rgba(168,139,250,0.15); color: var(--accent-purple); }
.status-published { background: rgba(16,185,129,0.15); color: var(--accent-emerald); }
.status-archived  { background: rgba(100,116,139,0.1); color: var(--text-muted); }
.status-processing { background: rgba(56,189,248,0.15); color: var(--accent-sky); }
.status-failed    { background: rgba(244,63,94,0.15); color: var(--accent-rose); }

/* ─── Viral Score ────────────────────────────────────────────────────────────── */

.viral-score {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 20px;
}
.score-high   { background: rgba(16,185,129,0.2); color: var(--accent-emerald); }
.score-mid    { background: rgba(56,189,248,0.2); color: var(--accent-sky); }
.score-low    { background: rgba(100,116,139,0.2); color: var(--text-secondary); }

/* ─── Flash Messages ─────────────────────────────────────────────────────────── */

.flash-container { padding: 0 24px; }
.flash {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.flash-error   { background: rgba(244,63,94,0.12); border: 1px solid rgba(244,63,94,0.3); color: #fca5a5; }
.flash-success { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.flash-info    { background: rgba(6,182,212,0.12); border: 1px solid rgba(6,182,212,0.3); color: #67e8f9; }

/* ─── Toggle Switch ──────────────────────────────────────────────────────────── */

.toggle-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle-switch input { display: none; }
.toggle-slider {
  width: 44px; height: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  position: relative;
  transition: var(--transition);
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition);
}
.toggle-switch input:checked ~ .toggle-slider { background: rgba(6,182,212,0.3); border-color: var(--accent-cyan); }
.toggle-switch input:checked ~ .toggle-slider::after { left: 23px; background: var(--accent-cyan); }

/* ─── Scrollbar ──────────────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Utilities ──────────────────────────────────────────────────────────────── */

.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ─── Error Page ─────────────────────────────────────────────────────────────── */

.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; text-align: center; }
.error-code { font-family: var(--font-mono); font-size: 6rem; font-weight: 700; color: var(--accent-cyan); opacity: 0.3; line-height: 1; }
.error-message { font-size: 1.25rem; color: var(--text-secondary); margin-top: 16px; }

/* ─── Auth Pages ─────────────────────────────────────────────────────────────── */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
}
.auth-container {
  width: 100%;
  max-width: 440px;
  padding: 24px;
}
.auth-logo-wrap { text-align: center; margin-bottom: 32px; }
.auth-logo-img {
  height: 68px;
  width: auto;
  margin: 0 auto;
  filter: drop-shadow(0 0 16px rgba(6,182,212,0.5));
}
.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 36px;
  box-shadow: var(--glow-cyan), var(--shadow-card);
}
.auth-title { text-align: center; margin-bottom: 28px; }
.auth-title h1 { font-size: 1.5rem; }
.auth-title p { color: var(--text-muted); margin-top: 6px; font-size: 0.9rem; }
.auth-footer { text-align: center; margin-top: 20px; color: var(--text-muted); font-size: 0.875rem; }

@media (max-width: 768px) {
  .main-content { padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
