/* ReelCMS - Professional SaaS Design System
   Clean, Unified Light Theme - No Dark Mode Toggle
*/

:root {
  --font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  /* Core Color Palette */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-subtle: #f8fafc;
  --bg-input: #ffffff;
  
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --border-focus: #3b82f6;
  
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-inverse: #ffffff;
  
  /* Brand & Accents */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-glow: rgba(37, 99, 235, 0.15);
  
  /* Stat Card Accent Colors (from reference UI) */
  --accent-amber: #f59e0b;
  --accent-amber-light: #fef3c7;
  --accent-emerald: #10b981;
  --accent-emerald-light: #d1fae5;
  --accent-blue: #0284c7;
  --accent-blue-light: #e0f2fe;
  --accent-rose: #f43f5e;
  --accent-rose-light: #ffe4e6;
  
  /* Status Colors */
  --success: #059669;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  
  --info: #0284c7;
  --info-bg: #f0f9ff;
  --info-border: #bae6fd;
  
  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px -1px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 30px -4px rgba(0, 0, 0, 0.08), 0 4px 12px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 40px -6px rgba(0, 0, 0, 0.12);
  
  /* Radii & Animation */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body, .app-body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ==========================================================================
   Navbar & Navigation
   ========================================================================== */
.navbar-wrapper {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.navbar {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none !important;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 3px 8px rgba(221, 42, 123, 0.3);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-version {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-links a.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 700;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.timezone-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 10px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  box-shadow: var(--shadow-xs);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-name {
  font-weight: 600;
  color: var(--text-main);
}

.logout-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: #f1f5f9;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  transition: var(--transition);
}
.logout-link:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* ==========================================================================
   Container & Page Header
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  flex: 1;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
  line-height: 1.2;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 4px;
}

/* ==========================================================================
   Modern Stat Cards (Styled after User Screenshot)
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

/* Distinct Top Border Accent Lines */
.stat-card-amber {
  border-top: 4px solid var(--accent-amber);
}

.stat-card-emerald {
  border-top: 4px solid var(--accent-emerald);
}

.stat-card-blue {
  border-top: 4px solid var(--accent-blue);
}

.stat-card-rose {
  border-top: 4px solid var(--accent-rose);
}

/* Stat Card Interior */
.stat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
  font-weight: 800;
  line-height: 1.3;
}

.stat-badge-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  margin: 12px 0 4px 0;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-subtext {
  font-size: 0.88rem;
  font-weight: 700;
  color: #059669; /* Green text highlight matching screenshot */
  margin-bottom: 8px;
}

.stat-subtext-danger {
  color: var(--danger);
}

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

/* Micro Progress Bar */
.micro-progress {
  height: 6px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: auto;
  position: relative;
}

.micro-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease-out;
}

.fill-amber { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.fill-emerald { background: linear-gradient(90deg, #10b981, #34d399); }
.fill-blue { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.fill-rose { background: linear-gradient(90deg, #f43f5e, #fb7185); }

/* ==========================================================================
   Cards & Panels
   ========================================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 4px 14px rgba(0, 0, 0, 0.02);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================================
   Forms & Controls
   ========================================================================== */
.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.form-control, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.form-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.form-col {
  flex: 1;
  min-width: 280px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none !important;
  font-family: inherit;
  box-shadow: var(--shadow-xs);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: 1px solid #1d4ed8;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}
.btn-secondary:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}
.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}
.btn-success:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}
.btn-warning:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: 6px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid var(--info-border);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.badge-secondary {
  background: #f1f5f9;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* ==========================================================================
   Alerts
   ========================================================================== */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-xs);
}

.alert-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}

.alert-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.alert-text {
  flex: 1;
  line-height: 1.5;
}

.alert-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: inherit;
  cursor: pointer;
  opacity: 0.6;
  transition: var(--transition);
  line-height: 1;
}
.alert-close:hover {
  opacity: 1;
}

.alert-success {
  background: var(--success-bg);
  color: #065f46;
  border: 1px solid var(--success-border);
  border-left: 5px solid #10b981;
}
.alert-success .alert-icon { background: #10b981; color: #fff; }

.alert-danger {
  background: var(--danger-bg);
  color: #991b1b;
  border: 1px solid var(--danger-border);
  border-left: 5px solid #ef4444;
}
.alert-danger .alert-icon { background: #ef4444; color: #fff; }

.alert-warning {
  background: var(--warning-bg);
  color: #92400e;
  border: 1px solid var(--warning-border);
  border-left: 5px solid #f59e0b;
}
.alert-warning .alert-icon { background: #f59e0b; color: #fff; }

.alert-info {
  background: var(--info-bg);
  color: #075985;
  border: 1px solid var(--info-border);
  border-left: 5px solid #0284c7;
}
.alert-info .alert-icon { background: #0284c7; color: #fff; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.table th {
  padding: 14px 20px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  background: #ffffff;
  color: var(--text-main);
}

.table tr:hover td {
  background: #f8fafc;
}

.table tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   9:16 Phone Mockup Reel Preview
   ========================================================================== */
.phone-mockup-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.phone-mockup {
  width: 280px;
  height: 497px;
  background: #0f172a;
  border: 10px solid #1e293b;
  border-radius: 40px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.phone-mockup video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.phone-mockup .placeholder-text {
  color: #94a3b8;
  text-align: center;
  padding: 24px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.phone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 85px;
  height: 16px;
  background: #1e293b;
  border-radius: 12px;
  z-index: 10;
}

.preview-sound-btn {
  position: absolute;
  bottom: 20px;
  right: 14px;
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 20;
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: var(--transition);
}
.preview-sound-btn:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: #fff;
  transform: scale(1.05);
}

/* ==========================================================================
   Counters, Progress & Upload
   ========================================================================== */
.counter-box {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.counter-item.exceeded {
  color: var(--danger);
  font-weight: 800;
}

.progress-container {
  display: none;
  margin-top: 16px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  height: 12px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #8b5cf6);
  border-radius: var(--radius-full);
  transition: width 0.15s ease;
}

/* ==========================================================================
   Filter Bar
   ========================================================================== */
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-content {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  margin-top: auto;
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  background: #ffffff;
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
  }
  .nav-left {
    flex-direction: column;
    gap: 14px;
    width: 100%;
  }
  .nav-links {
    flex-wrap: wrap;
  }
  .nav-right {
    width: 100%;
    justify-content: space-between;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    flex-direction: column;
  }
}
