/**
 * MyVideoStudio Frontend Design System v2 — Customer-facing.
 *
 * Single source of truth for tokens + components used across:
 *   - Dashboard ([myvideostudio_dashboard])
 *   - Slideshow Builder ([myvideostudio_slideshow])
 *   - Login Page ([myvideostudio_login])
 *   - Account Page ([myvideostudio_account])
 *
 * Mobile-first, native-app feel.
 *
 * @since 1.15.0
 */

/* ====================================================================
   1. DESIGN TOKENS (cohérence totale, prefix .mvs-fe-)
   ==================================================================== */

.mvs-fe {
  /* Brand — aligned to MyVideoStudio strict charter (primary #3C50E0) */
  --fe-brand-50: #EEF1FE;
  --fe-brand-100: #DCE1FC;
  --fe-brand-200: #BAC4F9;
  --fe-brand-300: #8E9CF2;
  --fe-brand-400: #6473EA;
  --fe-brand-500: #3C50E0;
  --fe-brand-600: #2F40C7;
  --fe-brand-700: #2536A0;
  --fe-brand-800: #1E2C82;
  --fe-brand-900: #1A2566;

  /* Accent — monochromatic brand (charter has no purple/fuchsia) */
  --fe-accent-400: #6473EA;
  --fe-accent-500: #3C50E0;
  --fe-accent-600: #2F40C7;

  /* Module gradients — de-purpled, charter-led */
  --fe-grad-video: linear-gradient(135deg, #3C50E0, #2F40C7);
  --fe-grad-image: linear-gradient(135deg, #06B6D4, #10B981);
  --fe-grad-slideshow: linear-gradient(135deg, #F59E0B, #EF4444);
  --fe-grad-audio: linear-gradient(135deg, #EC4899, #F97316);
  --fe-grad-avatar: linear-gradient(135deg, #3C50E0, #06B6D4);
  --fe-grad-brand: linear-gradient(135deg, #3C50E0, #2F40C7);

  /* Neutrals — charter slate ramp (bg #F1F5F9 → ink #1C2434) */
  --fe-grey-50: #F1F5F9;
  --fe-grey-100: #E2E8F0;
  --fe-grey-200: #CBD5E1;
  --fe-grey-300: #94A3B8;
  --fe-grey-400: #64748B;
  --fe-grey-500: #475569;
  --fe-grey-600: #334155;
  --fe-grey-700: #1E293B;
  --fe-grey-800: #1C2434;
  --fe-grey-900: #0F172A;

  /* Semantic */
  --fe-success-50: #ECFDF5;
  --fe-success-500: #10B981;
  --fe-success-600: #059669;
  --fe-warning-50: #FFFBEB;
  --fe-warning-500: #F59E0B;
  --fe-warning-600: #D97706;
  --fe-danger-50: #FEF2F2;
  --fe-danger-500: #EF4444;
  --fe-danger-600: #DC2626;
  --fe-info-50: #EFF1FE;
  --fe-info-500: #3C50E0;

  /* Typography — charter: Plus Jakarta Sans + Instrument Serif accents */
  --fe-font: 'Plus Jakarta Sans', system-ui, -apple-system, "Segoe UI", sans-serif;
  --fe-font-serif: 'Instrument Serif', Georgia, "Times New Roman", serif;
  --fe-font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;

  /* Sizing */
  --fe-space-1: 4px;
  --fe-space-2: 8px;
  --fe-space-3: 12px;
  --fe-space-4: 16px;
  --fe-space-5: 20px;
  --fe-space-6: 24px;
  --fe-space-8: 32px;
  --fe-space-10: 40px;
  --fe-space-12: 48px;

  --fe-radius-sm: 6px;
  --fe-radius-md: 10px;
  --fe-radius-lg: 14px;
  --fe-radius-xl: 20px;
  --fe-radius-2xl: 28px;

  /* Shadows */
  --fe-shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --fe-shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.06);
  --fe-shadow-md: 0 4px 8px -2px rgba(16, 24, 40, 0.10), 0 2px 4px -2px rgba(16, 24, 40, 0.06);
  --fe-shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
  --fe-shadow-xl: 0 20px 25px -5px rgba(16, 24, 40, 0.10), 0 8px 10px -6px rgba(16, 24, 40, 0.05);

  --fe-trans-fast: 150ms ease;
  --fe-trans-base: 200ms ease;
  --fe-trans-slow: 300ms ease;

  /* Z-index scale */
  --fe-z-base: 1;
  --fe-z-sticky: 50;
  --fe-z-drawer: 100;
  --fe-z-modal: 200;
  --fe-z-toast: 300;

  font-family: var(--fe-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--fe-grey-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mvs-fe *, .mvs-fe *::before, .mvs-fe *::after { box-sizing: border-box; }

/* ====================================================================
   2. BUTTONS
   ==================================================================== */

.mvs-fe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--fe-space-2);
  min-height: 44px;
  padding: 0 var(--fe-space-5);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--fe-radius-md);
  cursor: pointer;
  transition: all var(--fe-trans-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.mvs-fe-btn:focus-visible {
  outline: 2px solid var(--fe-brand-500);
  outline-offset: 2px;
}

.mvs-fe-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mvs-fe-btn--primary {
  background: var(--fe-grad-brand);
  color: white;
  box-shadow: var(--fe-shadow-sm);
}
.mvs-fe-btn--primary:hover:not(:disabled) {
  box-shadow: var(--fe-shadow-md);
  transform: translateY(-1px);
  color: white;
}

.mvs-fe-btn--secondary {
  background: white;
  color: var(--fe-grey-800);
  border-color: var(--fe-grey-300);
}
.mvs-fe-btn--secondary:hover:not(:disabled) {
  border-color: var(--fe-grey-400);
  background: var(--fe-grey-50);
}

.mvs-fe-btn--ghost {
  background: transparent;
  color: var(--fe-grey-700);
}
.mvs-fe-btn--ghost:hover:not(:disabled) {
  background: var(--fe-grey-100);
  color: var(--fe-grey-900);
}

.mvs-fe-btn--danger {
  background: var(--fe-danger-500);
  color: white;
}
.mvs-fe-btn--danger:hover:not(:disabled) {
  background: var(--fe-danger-600);
  color: white;
}

.mvs-fe-btn--sm { min-height: 36px; padding: 0 var(--fe-space-3); font-size: 13px; }
.mvs-fe-btn--lg { min-height: 52px; padding: 0 var(--fe-space-6); font-size: 15px; }
.mvs-fe-btn--block { width: 100%; }

/* ====================================================================
   3. CARDS
   ==================================================================== */

.mvs-fe-card {
  background: white;
  border: 1px solid var(--fe-grey-200);
  border-radius: var(--fe-radius-xl);
  padding: var(--fe-space-5);
  box-shadow: var(--fe-shadow-xs);
  transition: box-shadow var(--fe-trans-fast);
}

.mvs-fe-card--interactive {
  cursor: pointer;
}

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

.mvs-fe-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--fe-space-3);
  margin-bottom: var(--fe-space-3);
}

.mvs-fe-card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--fe-grey-900);
  margin: 0;
  letter-spacing: -0.01em;
}

.mvs-fe-card__subtitle {
  font-size: 13px;
  color: var(--fe-grey-500);
  margin: 2px 0 0;
}

/* ====================================================================
   4. STATS
   ==================================================================== */

.mvs-fe-stat {
  background: white;
  border: 1px solid var(--fe-grey-200);
  border-radius: var(--fe-radius-xl);
  padding: var(--fe-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--fe-space-2);
}

.mvs-fe-stat__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--fe-radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.mvs-fe-stat__icon--brand { background: var(--fe-brand-50); color: var(--fe-brand-600); }
.mvs-fe-stat__icon--success { background: var(--fe-success-50); color: var(--fe-success-600); }
.mvs-fe-stat__icon--warning { background: var(--fe-warning-50); color: var(--fe-warning-600); }
.mvs-fe-stat__icon--danger { background: var(--fe-danger-50); color: var(--fe-danger-600); }

.mvs-fe-stat__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--fe-grey-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mvs-fe-stat__value {
  font-size: 24px;
  font-weight: 800;
  color: var(--fe-grey-900);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ====================================================================
   5. INPUTS
   ==================================================================== */

.mvs-fe-input,
.mvs-fe-textarea,
.mvs-fe-select {
  width: 100%;
  padding: 0 var(--fe-space-4);
  height: 44px;
  background: white;
  border: 1px solid var(--fe-grey-300);
  border-radius: var(--fe-radius-md);
  font-family: inherit;
  font-size: 14px;
  color: var(--fe-grey-900);
  transition: all var(--fe-trans-fast);
}

.mvs-fe-input:focus,
.mvs-fe-textarea:focus,
.mvs-fe-select:focus {
  outline: 0;
  border-color: var(--fe-brand-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.10);
}

.mvs-fe-textarea {
  height: auto;
  min-height: 100px;
  padding: var(--fe-space-3) var(--fe-space-4);
  resize: vertical;
}

.mvs-fe-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--fe-grey-700);
  margin-bottom: var(--fe-space-2);
}

/* ====================================================================
   6. BADGES
   ==================================================================== */

.mvs-fe-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
}

.mvs-fe-badge--brand { background: var(--fe-brand-50); color: var(--fe-brand-700); }
.mvs-fe-badge--success { background: var(--fe-success-50); color: var(--fe-success-600); }
.mvs-fe-badge--warning { background: var(--fe-warning-50); color: var(--fe-warning-600); }
.mvs-fe-badge--danger { background: var(--fe-danger-50); color: var(--fe-danger-600); }
.mvs-fe-badge--neutral { background: var(--fe-grey-100); color: var(--fe-grey-700); }

/* ====================================================================
   7. AVATAR
   ==================================================================== */

.mvs-fe-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--fe-grad-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.mvs-fe-avatar--lg { width: 56px; height: 56px; font-size: 20px; }
.mvs-fe-avatar--sm { width: 28px; height: 28px; font-size: 11px; }

/* ====================================================================
   8. UTILITIES
   ==================================================================== */

.mvs-fe-flex { display: flex; }
.mvs-fe-flex-col { display: flex; flex-direction: column; }
.mvs-fe-items-center { align-items: center; }
.mvs-fe-justify-between { justify-content: space-between; }
.mvs-fe-gap-2 { gap: var(--fe-space-2); }
.mvs-fe-gap-3 { gap: var(--fe-space-3); }
.mvs-fe-gap-4 { gap: var(--fe-space-4); }

.mvs-fe-text-muted { color: var(--fe-grey-500); }
.mvs-fe-text-xs { font-size: 11px; }
.mvs-fe-text-sm { font-size: 12px; }
.mvs-fe-text-bold { font-weight: 600; }
.mvs-fe-text-center { text-align: center; }

/* Animations */
@keyframes mvs-fe-fadein {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.mvs-fe-fadein { animation: mvs-fe-fadein 0.25s ease; }

@keyframes mvs-fe-spin { to { transform: rotate(360deg); } }

.mvs-fe-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: mvs-fe-spin 0.7s linear infinite;
}
