/* ==========================================================
   Catalyst Content Studios — Design System (Premium Rebrand)
   ========================================================== */

:root {
  /* New Brand Colors from Palette */
  --brand-primary: #FFC20B;
  --brand-primary-hover: #E0AB00;
  --brand-dark: #272727;
  --brand-dark-hover: #1A1A1A;

  /* Functional Colors */
  --color-primary: #3B82F6; /* Kept for informational accents */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-danger: #EF4444;

  /* Surfaces */
  --bg-page: #F4F5F7; /* Very soft grey, almost white */
  --bg-card: #FFFFFF;
  --bg-hover: #F3F4F6;
  --bg-sidebar: #272727;
  
  /* Text */
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  
  /* Sidebar Text */
  --sidebar-text: #EBEBEB;
  --sidebar-text-muted: #7D7D7D;

  --border: #E5E7EB;
  --border-strong: #D1D5DB;

  /* Spacing & Radii */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 24px; --radius-full: 9999px;

  /* Shadows (softer, premium) */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.02);
}

[data-theme="dark"] {
  --bg-page: #1A1A1A;
  --bg-card: #272727;
  --bg-hover: #333333;
  --bg-sidebar: #111111;
  --text-primary: #F3F4F6;
  --text-secondary: #9CA3AF;
  --text-tertiary: #6B7280;
  --border: #333333;
  --border-strong: #444444;
}

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

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

a { color: var(--text-primary); text-decoration: none; font-weight: 500; }
a:hover { color: var(--brand-primary-hover); }

.app-layout { display: flex; min-height: 100vh; }

/* ---- Sidebar (Dark Premium) ---- */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: none;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  top: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-header .logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-dark);
  font-weight: 800;
  font-size: 18px;
}

.sidebar-header .brand-name {
  font-weight: 700;
  font-size: 16px;
  color: #FFFFFF;
}

.sidebar-nav {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  overflow-anchor: none; /* Stops browser from auto-jumping */
}

.nav-section { margin-bottom: 20px; }

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sidebar-text-muted);
  padding: 8px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  margin-bottom: 4px;
}

.nav-item:hover { background: rgba(255,255,255,0.08); color: #FFFFFF; }
.nav-item.active { 
    background: var(--brand-primary); 
    color: var(--brand-dark); 
    font-weight: 600;
}
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; opacity: 0.8; }
.nav-item.active .icon { opacity: 1; }

.sidebar-footer {
  padding: 16px;
  margin: 12px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
}

.user-card { display: flex; align-items: center; gap: 12px; }
.user-card .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand-primary); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.user-card .user-name { font-size: 14px; font-weight: 600; color: #FFFFFF; }
.user-card .user-role { font-size: 12px; color: var(--sidebar-text-muted); }

/* ---- Main Content ---- */
.main-content { flex: 1; margin-left: 260px; min-width: 0; }

.top-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar .menu-toggle { display: none; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-primary); }
.top-bar .page-title { flex: 1; font-size: 18px; font-weight: 600; color: var(--text-primary); }

.page-content { padding: 32px; max-width: 1400px; margin: 0 auto; }

/* ---- Cards (Soft, Premium) ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.card-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; letter-spacing: -0.3px; }
.card-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }

/* ---- Buttons (Strict Gold & Charcoal) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-md);
  border: 1px solid transparent; font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.15s ease; text-decoration: none; white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

/* Primary is now Gold with Dark Text */
.btn-primary { background: var(--brand-primary); color: var(--brand-dark); border-color: var(--brand-primary); }
.btn-primary:hover { background: var(--brand-primary-hover); border-color: var(--brand-primary-hover); }

/* Secondary is Charcoal with White Text */
.btn-secondary { background: var(--brand-dark); color: #FFFFFF; border-color: var(--brand-dark); }
.btn-secondary:hover { background: var(--brand-dark-hover); border-color: var(--brand-dark-hover); }

.btn-success { background: var(--color-success); color: white; }
.btn-warning { background: var(--color-warning); color: white; }
.btn-danger { background: var(--color-danger); color: white; }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }
.btn-block { width: 100%; }

/* ---- Forms ---- */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-md); font-family: inherit; font-size: 14px;
  color: var(--text-primary); background: var(--bg-card); transition: all 0.15s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(255, 194, 11, 0.2); /* Gold glow */
}

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: var(--radius-full); font-size: 12px; font-weight: 600;
}
.badge-blue { background: rgba(59,130,246,0.1); color: var(--color-primary); }
.badge-green { background: rgba(16,185,129,0.1); color: var(--color-success); }
.badge-amber { background: rgba(245,158,11,0.1); color: var(--color-warning); }
.badge-red { background: rgba(239,68,68,0.1); color: var(--color-danger); }
.badge-gray { background: var(--bg-hover); color: var(--text-secondary); }

/* ---- Stats Grid (Premium Look) ---- */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px; margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm);
  transition: all 0.2s ease; display: flex; flex-direction: column; justify-content: space-between;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card .stat-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); margin-bottom: 12px; }
.stat-card .stat-value { font-size: 32px; font-weight: 800; color: var(--text-primary); line-height: 1; letter-spacing: -1px; }
.stat-card .stat-icon { font-size: 20px; opacity: 0.8; }

/* ---- Tables ---- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.table td { padding: 16px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text-primary); }
.table tr:hover td { background: var(--bg-hover); }

/* ---- Toasts ---- */
.toast-container { position: fixed; top: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.toast {
  background: var(--bg-card); border: 1px solid var(--border); border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius-md); padding: 16px 20px; min-width: 300px; box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease; pointer-events: auto; font-size: 14px; font-weight: 500; color: var(--text-primary);
}
.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- Utility ---- */
.flex { display: flex; } .flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.text-sm { font-size: 13px; } .text-muted { color: var(--text-secondary); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .top-bar .menu-toggle { display: flex; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ==========================================================
   DARK SIDEBAR SCROLLBAR FIX
   ========================================================== */

/* WebKit (Chrome, Edge, Safari) */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Firefox */
.sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
