/* 
 * SBA AI — Sukses Bareng Affiliate AI — Design System
 * --------------------------------------------
 */

/* ==========================================================================
   1. CSS Custom Properties (Root Variables)
   ========================================================================== */
:root {
  /* Primary - Emerald */
  --primary: #059669;
  --primary-dark: #047857;
  --primary-darker: #065f46;
  --primary-light: #34d399;
  --primary-lighter: #6ee7b7;
  --primary-alpha: rgba(5, 150, 105, 0.12);
  --primary-bg: #ecfdf5;

  /* Secondary - Amber/Gold */
  --secondary: #d97706;
  --secondary-dark: #b45309;
  --secondary-light: #fbbf24;

  /* Status Colors */
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --info: #3b82f6;
  --info-bg: #dbeafe;

  /* Grayscale */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Backgrounds & Texts */
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --border: #e2e8f0;

  /* Border Radius */
  --radius-sm: 0.125rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* Transitions */
  --transition-fast: 150ms;
  --transition-normal: 250ms;
  --transition-slow: 400ms;

  /* Layout Variables */
  --sidebar-width: 260px;
  --header-height: 64px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Brand Accent Colors */
  --accent-1: #10b981;
  --accent-2: #f59e0b;
  --accent-1-alpha: rgba(16, 185, 129, 0.2);
  --accent-2-alpha: rgba(245, 158, 11, 0.2);
}

/* ==========================================================================
   1.5 Dark Theme Variables
   ========================================================================== */
[data-theme="dark"] {
  --bg-primary: #0f172a;       /* Dark slate background */
  --bg-secondary: #1e293b;     /* Slightly lighter for cards */
  --card-bg: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --border-light: #1e293b;
  --border: #334155;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  
  --primary-bg: #1e293b;
  --info-bg: rgba(59, 130, 246, 0.15);
  --success-bg: rgba(16, 185, 129, 0.15);
  --warning-bg: rgba(245, 158, 11, 0.15);
  --danger-bg: rgba(239, 68, 68, 0.15);

  --gray-50: #0f172a;
  --gray-100: #1e293b;
  --gray-200: #334155;
  --gray-800: #f1f5f9;
  --gray-900: #f8fafc;
}

/* TikTok Aesthetic Utility Classes */
.sba-glow-primary {
  box-shadow: 0 0 10px var(--accent-1-alpha), 0 0 20px var(--accent-1-alpha);
  border: 1px solid var(--accent-1);
}
.sba-glow-secondary {
  box-shadow: 0 0 10px var(--accent-2-alpha), 0 0 20px var(--accent-2-alpha);
  border: 1px solid var(--accent-2);
}
.sba-gradient-text {
  background: linear-gradient(45deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* Light mode glass card - visible on light backgrounds */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-2xl);
}
[data-theme="dark"] .glass-card {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   2. Reset & Base Styles
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

html {
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1rem;
}

::selection {
  background-color: var(--primary-bg);
  color: var(--primary-darker);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast) ease;
}

a:hover {
  color: var(--primary-dark);
}

ul, ol {
  list-style: none;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   3. Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 0.5em;
  line-height: 1.2;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-white { color: #fff; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* ==========================================================================
   4. Layout System
   ========================================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--bg-secondary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform var(--transition-normal) ease;
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
  border-radius: var(--radius-xl);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition-fast) ease;
  cursor: pointer;
  text-decoration: none;
}

.sidebar-nav-item:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.sidebar-nav-item.active {
  background-color: var(--primary-bg);
  color: var(--primary);
}

.sidebar-nav-item i {
  margin-right: 0.75rem;
  font-size: 1.25rem;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 40;
  display: none;
  opacity: 0;
  transition: opacity var(--transition-normal) ease;
}

.sidebar-overlay.open {
  display: block;
  opacity: 1;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-normal) ease;
}

.header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background-color: var(--bg-primary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 30;
}

.content-area {
  padding: 2rem;
  flex: 1;
  overflow-y: auto;
}

/* ==========================================================================
   5. Card Components
   ========================================================================== */
.card {
  background-color: var(--card-bg);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast) ease, box-shadow var(--transition-fast) ease;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

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

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-primary);
}

.stat-card {
  background-color: var(--card-bg);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-fast) ease;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card--primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
}

.stat-card--glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-card--primary .stat-label,
.stat-card--primary .stat-value {
  color: #fff;
}

.stat-content {
  flex: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.primary { background-color: var(--primary-bg); color: var(--primary); }
.stat-icon.success { background-color: var(--success-bg); color: var(--success); }
.stat-icon.warning { background-color: var(--warning-bg); color: var(--warning); }
.stat-icon.danger { background-color: var(--danger-bg); color: var(--danger); }

/* ==========================================================================
   6. Button Components
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-xl);
  border: 1px solid transparent;
  transition: all var(--transition-fast) ease;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  user-select: none;
}

.btn i {
  margin-right: 0.5rem;
}

.btn-primary {
  background: linear-gradient(to right, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(to right, var(--primary-dark), var(--primary-darker));
  box-shadow: 0 4px 6px rgba(5, 150, 105, 0.3);
}

.btn-secondary {
  background-color: var(--gray-100);
  color: var(--gray-700);
  border-color: var(--gray-200);
}

.btn-secondary:hover {
  background-color: var(--gray-200);
  color: var(--gray-900);
}

.btn-success { background-color: var(--success); color: #fff; }
.btn-success:hover { background-color: #059669; }

.btn-danger { background-color: var(--danger); color: #fff; }
.btn-danger:hover { background-color: #dc2626; }

.btn-warning { background-color: var(--warning); color: #fff; }
.btn-warning:hover { background-color: #d97706; }

.btn-ghost {
  background-color: transparent;
  color: var(--primary);
}

.btn-ghost:hover {
  background-color: var(--primary-bg);
}

.btn-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn-gradient:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-xl);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon i {
  margin: 0;
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  border-radius: var(--radius-lg);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--radius-xl);
}

.btn:disabled, .btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-spinner {
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}

/* ==========================================================================
   7. Form Elements
   ========================================================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-primary);
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast) ease;
  outline: none;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
}

.form-error {
  display: block;
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 0.25rem;
}

.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ==========================================================================
   8. Upload Zone
   ========================================================================== */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-xl);
  padding: 2.5rem 1.5rem;
  text-align: center;
  transition: all var(--transition-fast) ease;
  cursor: pointer;
  background-color: var(--bg-primary);
}

.upload-zone:hover {
  border-color: var(--primary);
  background-color: rgba(238, 242, 255, 0.5); /* primary-bg / 50 */
}

.upload-zone.dragover {
  border-color: var(--primary);
  background-color: var(--primary-bg);
  transform: scale(1.01);
}

.upload-zone-icon {
  font-size: 3rem;
  color: var(--gray-400);
  margin: 0 auto 1rem;
  transition: color var(--transition-fast) ease;
}

.upload-zone:hover .upload-zone-icon {
  color: var(--primary);
}

.upload-zone-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.upload-zone-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   9. Image Grid & Gallery
   ========================================================================== */
.image-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(4, 1fr);
}

.image-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  transition: all var(--transition-fast) ease;
}

.image-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.image-wrapper {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background-color: var(--gray-100);
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow) ease;
}

.image-card:hover .image-wrapper img {
  transform: scale(1.05);
}

.image-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity var(--transition-normal) ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.image-card:hover .image-overlay {
  opacity: 1;
}

.image-checkbox {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-actions {
  display: flex;
  gap: 0.5rem;
}

.image-actions .btn {
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.image-actions .btn:hover {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* ==========================================================================
   10. Modal
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal) ease;
}

.modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--card-bg);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition-normal) ease;
}

.modal-backdrop.show .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--gray-500);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.modal-close:hover {
  background-color: var(--gray-100);
  color: var(--gray-900);
}

.modal-backdrop.dark-mode .modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  z-index: 60;
}

.modal-image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
}

/* ==========================================================================
   11. Toast / Notification
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background-color: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  max-width: 400px;
}

.toast--success { border-left-color: var(--success); }
.toast--success i { color: var(--success); }

.toast--error { border-left-color: var(--danger); }
.toast--error i { color: var(--danger); }

.toast--warning { border-left-color: var(--warning); }
.toast--warning i { color: var(--warning); }

.toast--info { border-left-color: var(--info); }
.toast--info i { color: var(--info); }

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.toast-message {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.toast-close {
  color: var(--gray-400);
  cursor: pointer;
  background: none;
  border: none;
}
.toast-close:hover { color: var(--gray-600); }

.toast-enter {
  animation: slideInRight 300ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-exit {
  animation: slideOutRight 300ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   12. Badge
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  line-height: 1;
  white-space: nowrap;
}

.badge--primary { background-color: var(--primary-bg); color: var(--primary-dark); }
.badge--success { background-color: var(--success-bg); color: var(--success); }
.badge--danger { background-color: var(--danger-bg); color: var(--danger); }
.badge--warning { background-color: var(--warning-bg); color: var(--warning); }
.badge--info { background-color: var(--info-bg); color: var(--info); }

.badge--pulse {
  position: relative;
}
.badge--pulse::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 0.375rem;
  background-color: currentColor;
  animation: pulse 2s infinite;
}

/* ==========================================================================
   13. Skeleton Loading
   ========================================================================== */
.skeleton {
  background-color: var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.5s infinite;
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 0.25rem;
}

.skeleton-text.w-1-2 { width: 50%; }
.skeleton-text.w-3-4 { width: 75%; }
.skeleton-text.w-full { width: 100%; }

.skeleton-card {
  height: 200px;
  border-radius: var(--radius-2xl);
}

.skeleton-image {
  aspect-ratio: 3/4;
  border-radius: var(--radius-xl);
}

/* ==========================================================================
   14. Animations & Keyframes
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); opacity: 1; }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-fadeIn { animation: fadeIn 0.5s ease forwards; }
.animate-fadeInUp { animation: fadeInUp 0.5s ease forwards; }
.animate-fadeInDown { animation: fadeInDown 0.5s ease forwards; }
.animate-slideInLeft { animation: slideInLeft 0.3s ease forwards; }
.animate-slideInRight { animation: slideInRight 0.3s ease forwards; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* ==========================================================================
   15. Scrollbar
   ========================================================================== */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* Base scrollbar for the whole page */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ==========================================================================
   16. Utility Classes
   ========================================================================== */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-4 { margin: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-auto { overflow-x: auto; }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

.border { border: 1px solid var(--border-color); }
.border-t { border-top: 1px solid var(--border-color); }
.border-b { border-bottom: 1px solid var(--border-color); }
.border-l { border-left: 1px solid var(--border-color); }
.border-r { border-right: 1px solid var(--border-color); }

.bg-white { background-color: #fff; }
.bg-transparent { background-color: transparent; }
.bg-gray-50 { background-color: var(--gray-50); }

.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

.select-none { user-select: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-60 { z-index: 60; }

/* ==========================================================================
   17. Responsive Breakpoints
   ========================================================================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .hide-mobile {
    display: none !important;
  }
  
  .content-area {
    padding: 1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  .studio-layout {
    flex-direction: column !important;
  }
  
  .studio-config {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-color);
  }
  
  .studio-results {
    width: 100% !important;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .image-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (min-width: 1025px) {
  .hide-desktop {
    display: none !important;
  }
}

/* ==========================================================================
   18. Auth Page Styles
   ========================================================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(-45deg, var(--primary-bg), var(--bg-primary), var(--primary-lighter), var(--bg-secondary));
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  padding: 1.5rem;
}

.auth-card {
  background-color: var(--card-bg);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 28rem;
  overflow: hidden;
  position: relative;
  z-index: 10;
}

.auth-card-inner {
  padding: 2.5rem;
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.auth-logo-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.75rem;
  box-shadow: 0 10px 15px -3px rgba(5, 150, 105, 0.4);
  transform: rotate(-10deg);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.auth-card:hover .auth-logo-icon {
  transform: rotate(0deg);
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--gray-500);
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-logo i, .auth-logo svg,
.auth-logo-icon i, .auth-logo-icon svg {
  width: 28px;
  height: 28px;
}

.auth-form .form-group {
  margin-bottom: 1.25rem;
}

.auth-form .form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
}

.auth-form .form-input {
  width: 100%;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
}

.auth-footer p {
  font-size: 0.85rem;
  color: var(--gray-500);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast) ease;
}

.auth-footer a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ==========================================================================
   19. Dashboard Specific
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  padding: 1rem;
  border-radius: var(--radius-xl);
  transition: background-color var(--transition-fast) ease;
}

.activity-item:hover {
  background-color: var(--gray-50);
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background-color: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.25rem;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--gray-400);
}

/* ==========================================================================
   20. Studio Specific
   ========================================================================== */
.studio-layout {
  display: flex;
  flex-direction: row;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}

.studio-config {
  width: 33.333%;
  background-color: var(--card-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.studio-config-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.studio-config-body {
  padding: 1.5rem;
  flex: 1;
}

.studio-results {
  width: 66.666%;
  background-color: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
}

.photo-preview-list {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
}

.photo-preview-item {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: all var(--transition-fast) ease;
}

.photo-preview-item.selected {
  border-color: var(--primary);
}

.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--danger);
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  opacity: 0;
  cursor: pointer;
  transition: opacity var(--transition-fast) ease;
}

.photo-preview-item:hover .photo-preview-remove {
  opacity: 1;
}

.bulk-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.bulk-actions-info {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.bulk-actions-buttons {
  display: flex;
  gap: 0.5rem;
}

/* ==========================================================================
   21. Studio Enhancements (Phase 2)
   ========================================================================== */

/* Icon inline with text */
.icon-inline {
  display: inline-block;
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-right: 6px;
  color: var(--primary);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}

.btn-icon-left {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

/* Server Status Indicator */
.server-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  font-size: 0.8rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--gray-400);
  flex-shrink: 0;
}

.status-dot.status-online {
  background-color: var(--success);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

.status-dot.status-offline {
  background-color: var(--danger);
}

.status-text {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Results Panel */
.results-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.results-body {
  flex: 1;
  overflow-y: auto;
  min-height: 400px;
}

.results-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

.results-empty-icon {
  width: 64px;
  height: 64px;
  opacity: 0.15;
  margin-bottom: 1rem;
}

.results-empty-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.results-empty-hint {
  font-size: 0.85rem;
  max-width: 320px;
}

.results-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  color: var(--text-muted);
  gap: 1rem;
  padding: 2rem;
}

/* Spinner Ring */
.spinner-ring {
  width: 48px;
  height: 48px;
  border: 4px solid var(--primary-bg);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Image Overlay Buttons */
.btn-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast) ease;
}

.btn-overlay:hover {
  background: rgba(255, 255, 255, 0.35);
}

.btn-overlay-primary {
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.4);
}

.btn-overlay-primary:hover {
  background: var(--primary-dark);
}

.btn-overlay i, .btn-overlay svg {
  width: 16px;
  height: 16px;
}

/* Image Card Selected State */
.image-card.selected {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px var(--primary-lighter), var(--shadow-md);
}

/* Image card loading skeleton */
.image-card-loading {
  pointer-events: none;
}

.image-card-loading .image-wrapper {
  position: relative;
}

/* Divider */
.divider-vertical {
  width: 1px;
  height: 20px;
  background: var(--gray-300);
  margin: 0 4px;
}

/* Bulk actions responsive */
.bulk-actions-bar {
  flex-wrap: wrap;
  gap: 8px;
}

/* Card footer */
.card-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-light);
}

/* Button block */
.btn-block {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
}

/* Text utilities */
.text-sm {
  font-size: 0.875rem;
}

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

.mb-3 {
  margin-bottom: 0.75rem;
}

/* Config form spacing */
.config-form .form-group {
  margin-bottom: 1.25rem;
}

/* Studio responsive fixes */
@media (max-width: 1024px) {
  .studio-layout {
    flex-direction: column;
  }
  .studio-config, .studio-results {
    width: 100%;
  }
  .results-header {
    flex-direction: column;
  }
}

@media (min-width: 1025px) {
  .studio-results .card {
    height: calc(100vh - var(--header-height) - 4rem);
    display: flex;
    flex-direction: column;
  }
}

/* ==========================================================================
   22. Video Maker Enhancements (Phase 3)
   ========================================================================== */

/* Mini Image Grid (for source selection) */
.mini-image-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
}

.mini-image-item {
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast) ease;
}

.mini-image-item:hover {
  border-color: var(--primary-light);
  transform: scale(1.05);
}

.mini-image-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-lighter);
}

.mini-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.selected-source.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-lighter);
}

/* Selected Image Preview */
.selected-image-preview {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--gray-50);
}

.selected-image-preview img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
}

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 120px;
  color: var(--text-muted);
  gap: 8px;
}

/* Accordion */
.image-select-accordion summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.image-select-accordion summary::-webkit-details-marker {
  display: none;
}

/* Video Processing Card */
.video-processing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.processing-card {
  text-align: center;
  max-width: 400px;
  padding: 2rem;
}

.processing-card h3 {
  margin-top: 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Progress Steps */
.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 2rem auto;
  max-width: 280px;
  text-align: left;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  transition: all var(--transition-normal) ease;
  font-size: 0.875rem;
}

.progress-step .step-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gray-100);
  flex-shrink: 0;
}

.progress-step .step-icon i,
.progress-step .step-icon svg {
  width: 16px;
  height: 16px;
}

.progress-step.active {
  color: var(--primary);
  background: var(--primary-bg);
  font-weight: 500;
}

.progress-step.active .step-icon {
  background: var(--primary);
  color: white;
  animation: pulse 2s ease-in-out infinite;
}

.progress-step.completed {
  color: var(--success);
}

.progress-step.completed .step-icon {
  background: var(--success-bg);
  color: var(--success);
}

/* Video Player */
.video-player-wrapper {
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: #000;
  margin-bottom: 1.5rem;
}

.video-player {
  width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: contain;
  display: block;
}

.video-result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Error State */
.video-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.error-card {
  text-align: center;
  max-width: 400px;
  padding: 2rem;
}

.error-icon {
  width: 48px;
  height: 48px;
  color: var(--danger);
  margin-bottom: 1rem;
}

.error-card h3 {
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* Small empty state */
.empty-state-sm {
  padding: 1rem;
  text-align: center;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
}

.empty-state-sm a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.empty-state-sm a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   23. Gallery & Settings (Phase 4)
   ========================================================================== */

/* Gallery */
.gallery-container {
  width: 100%;
  max-width: 100%;
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 12px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.video-card {
  background: var(--card-bg);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all var(--transition-normal) ease;
}

.video-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.video-thumbnail {
  position: relative;
  aspect-ratio: 9/16;
  background: var(--gray-900);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-thumb-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  opacity: 1;
  transition: opacity var(--transition-fast) ease;
  pointer-events: none;
}

.video-card:hover .video-play-icon {
  opacity: 0;
}

.video-play-icon i {
  width: 40px;
  height: 40px;
  color: white;
}

.video-thumb-loading, .video-thumb-failed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  gap: 8px;
  font-size: 0.85rem;
}

.video-thumb-failed {
  color: var(--danger);
}

.video-card-info {
  padding: 0.75rem 1rem;
}

.video-card-prompt {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.video-card-actions {
  display: flex;
  gap: 4px;
  padding: 0 0.75rem 0.75rem;
  justify-content: flex-end;
}

/* Settings */
.settings-container {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-card .card-body {
  padding: 1.5rem;
}

/* Alert */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.alert-success {
  background: var(--success-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-danger {
  background: var(--danger-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Account Info Grid */
.account-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.account-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
}

.account-info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.account-info-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Form invalid state */
.form-input.is-invalid {
  border-color: var(--danger);
}

.form-error {
  display: block;
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 4px;
}

/* Pagination */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.pagination-wrapper nav {
  display: flex;
  gap: 4px;
}

.pagination-wrapper a,
.pagination-wrapper span {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast) ease;
}

.pagination-wrapper a {
  color: var(--text-secondary);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}

.pagination-wrapper a:hover {
  background: var(--primary-bg);
  border-color: var(--primary-light);
  color: var(--primary);
}

.pagination-wrapper span[aria-current="page"] span {
  background: var(--primary);
  color: white;
  border: 1px solid var(--primary);
}

@media (max-width: 768px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
  .account-info-grid {
    grid-template-columns: 1fr;
  }
}

