/* design-system.css — MyPod Design System Foundation */

/* ============================================
   1. CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
  /* Colors — Primary */
  --mypod-primary: #7C6AEF;
  --mypod-primary-hover: #6B5CE0;
  --mypod-primary-light: rgba(124, 106, 239, 0.1);

  /* Colors — Accent */
  --mypod-accent: #FF6B6B;
  --mypod-accent-hover: #E85D5D;

  /* Colors — Semantic */
  --mypod-success: #34D399;
  --mypod-success-light: rgba(52, 211, 153, 0.1);
  --mypod-warning: #FBBF24;
  --mypod-warning-light: rgba(251, 191, 36, 0.1);
  --mypod-danger: #EF4444;
  --mypod-danger-light: rgba(239, 68, 68, 0.1);
  --mypod-info: #60A5FA;
  --mypod-info-light: rgba(96, 165, 250, 0.1);

  /* Colors — Audio */
  --mypod-audio: #A78BFA;
  --mypod-audio-light: rgba(167, 139, 250, 0.15);

  /* Colors — Surfaces */
  --mypod-bg: #FAFAF8;
  --mypod-surface: #FFFFFF;
  --mypod-surface-secondary: #F5F5F3;
  --mypod-border: #E5E5E3;

  /* Colors — Text */
  --mypod-text: #1A1A2E;
  --mypod-text-secondary: #6B7280;

  /* Colors — Semantic backgrounds (for notification bars, banners) */
  --mypod-warning-bg: rgba(245, 158, 11, 0.1);
  --mypod-success-bg: rgba(34, 197, 94, 0.1);

  /* Warm storytelling tones */
  --mypod-warm: #F59E0B;
  --mypod-warm-light: #FFFBEB;
  --mypod-warm-border: #FDE68A;

  /* Shadows */
  --mypod-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --mypod-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --mypod-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);

  /* Border Radius */
  --mypod-radius-sm: 6px;
  --mypod-radius-md: 8px;
  --mypod-radius-lg: 12px;
  --mypod-radius-pill: 20px;
  --mypod-radius-full: 50%;

  /* Spacing (4px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* Transitions */
  --transition-fast: 100ms ease;
  --transition-base: 150ms ease;
  --transition-slow: 300ms ease;

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 640px;
  --max-width-form: 520px;
}

/* ============================================
   2. CSS Reset
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--mypod-text);
  background-color: var(--mypod-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--mypod-text);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { margin-bottom: var(--sp-4); }
p:last-child { margin-bottom: 0; }

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

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

input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

ul, ol { list-style: none; }

/* ============================================
   3. Base Form Elements
   ============================================ */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
  display: block;
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-base);
  color: var(--mypod-text);
  background: var(--mypod-surface);
  border: 1px solid var(--mypod-border);
  border-radius: var(--mypod-radius-sm);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--mypod-primary);
  box-shadow: 0 0 0 3px var(--mypod-primary-light);
}

label {
  display: block;
  margin-bottom: var(--sp-1);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--mypod-text);
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  display: inline-block;
  margin-right: var(--sp-2);
  accent-color: var(--mypod-primary);
  cursor: pointer;
  vertical-align: middle;
}

label:has(input[type="checkbox"]),
label:has(input[type="radio"]) {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-weight: var(--weight-regular);
  cursor: pointer;
}

/* ============================================
   4. Utility Classes
   ============================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

.container-narrow {
  max-width: var(--max-width-narrow);
}

.container-form {
  max-width: var(--max-width-form);
}

.text-muted { color: var(--mypod-text-secondary); }
.text-success { color: var(--mypod-success); }
.text-warning { color: var(--mypod-warning); }
.text-danger { color: var(--mypod-danger); }
.text-center { text-align: center; }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }

.font-serif { font-family: var(--font-serif); }
.font-semibold { font-weight: var(--weight-semibold); }

.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }

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

.grid { display: grid; }

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

/* ============================================
   5. Animations
   ============================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

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

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-in {
  animation: fadeInUp 150ms ease-out;
}

/* ============================================
   8. Waveform Visual Motif
   ============================================ */

/* Static waveform decoration — SVG background */
.waveform-bg {
  position: relative;
}
.waveform-bg::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 32' preserveAspectRatio='none'%3E%3Cpath d='M0 24 Q10 16 20 20 Q30 24 40 12 Q50 0 60 16 Q70 28 80 20 Q90 8 100 16 Q110 24 120 12 Q130 4 140 20 Q150 28 160 16 Q170 8 180 24 Q190 28 200 20' fill='none' stroke='%237C6AEF' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 200px 32px;
  pointer-events: none;
}

/* Animated waveform pulse — for active/producing states */
.waveform-pulse {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 16px;
}
.waveform-pulse span {
  display: inline-block;
  width: 3px;
  background: var(--mypod-audio);
  border-radius: 2px;
  animation: waveformBounce 1.2s ease-in-out infinite;
}
.waveform-pulse span:nth-child(1) { height: 8px; animation-delay: 0s; }
.waveform-pulse span:nth-child(2) { height: 14px; animation-delay: 0.15s; }
.waveform-pulse span:nth-child(3) { height: 10px; animation-delay: 0.3s; }
.waveform-pulse span:nth-child(4) { height: 16px; animation-delay: 0.45s; }
.waveform-pulse span:nth-child(5) { height: 6px; animation-delay: 0.6s; }

@keyframes waveformBounce {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

/* Waveform background pattern */
.bg-warm {
    background: var(--mypod-warm-light);
}
.bg-waveform {
    position: relative;
}
.bg-waveform::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40'%3E%3Cpath d='M0 20 Q50 5 100 20 T200 20 T300 20 T400 20 T500 20 T600 20 T700 20 T800 20 T900 20 T1000 20 T1100 20 T1200 20' fill='none' stroke='%23FDE68A' stroke-width='1.5' opacity='0.5'/%3E%3C/svg%3E") repeat-x;
    pointer-events: none;
    opacity: 0.7;
}

/* Waveform section divider */
.wave-divider {
    height: 24px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 24'%3E%3Cpath d='M0 12 Q25 2 50 12 T100 12 T150 12 T200 12 T250 12 T300 12 T350 12 T400 12 T450 12 T500 12 T550 12 T600 12' fill='none' stroke='%23E5E5E3' stroke-width='1.5'/%3E%3C/svg%3E") repeat-x;
    margin: var(--sp-4) 0;
}

/* ============================================
   9. Serif Typography Utility
   ============================================ */
.font-serif {
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  font-weight: 600;
}
