/**
 * ASTROLOJE DESIGN SYSTEM v1.0
 * Sacred Jyotish Web-App Theme
 * Date: 2025-12-02
 *
 * A modern, app-like design system for Hindu Astrology
 * Cosmic, meditative, mobile-first
 */

/* ============================================================================
   1. CSS VARIABLES - DESIGN TOKENS
   ============================================================================ */

:root {
  /* ===== COLOR PALETTE ===== */

  /* Primary - Refined Saffron (less aggressive) */
  --color-primary: #FF9933;
  --color-primary-light: #FFB366;
  --color-primary-dark: #E67E22;
  --color-primary-subtle: #FFF4E6;

  /* Accent - Deep Cosmic Purple */
  --color-accent: #7C3AED;
  --color-accent-light: #A78BFA;
  --color-accent-dark: #5B21B6;

  /* Spiritual Gold */
  --color-gold: #F59E0B;
  --color-gold-light: #FCD34D;
  --color-gold-dark: #D97706;

  /* Semantic Colors */
  --color-benefic: #10B981;      /* Green - positive planets */
  --color-malefic: #EF4444;      /* Red - challenging planets */
  --color-neutral: #3B82F6;      /* Blue - neutral */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-error: #EF4444;
  --color-info: #3B82F6;

  /* Light Mode Colors */
  --bg-primary-light: #FAF9F4;           /* Off-white cream */
  --bg-secondary-light: #FFFFFF;         /* Pure white */
  --bg-elevated-light: #FFFFFF;          /* Cards */
  --bg-subtle-light: #F3F4F6;            /* Hover states */

  --text-primary-light: #1F2937;         /* Near black */
  --text-secondary-light: #6B7280;       /* Gray */
  --text-tertiary-light: #9CA3AF;        /* Light gray */
  --text-inverse-light: #FFFFFF;         /* White on dark */

  --border-light: #E5E7EB;
  --border-strong-light: #D1D5DB;
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-strong-light: rgba(0, 0, 0, 0.15);

  /* Dark Mode Colors - Cosmic Theme */
  --bg-primary-dark: #0E0F1A;            /* Deep cosmic navy */
  --bg-secondary-dark: #171A22;          /* Slightly lighter */
  --bg-elevated-dark: #1F2937;           /* Cards */
  --bg-subtle-dark: #252A35;             /* Hover states */

  --text-primary-dark: #F9FAFB;          /* Near white */
  --text-secondary-dark: #D1D5DB;        /* Light gray */
  --text-tertiary-dark: #9CA3AF;         /* Gray */
  --text-inverse-dark: #1F2937;          /* Dark on light */

  --border-dark: #374151;
  --border-strong-dark: #4B5563;
  --shadow-dark: rgba(0, 0, 0, 0.3);
  --shadow-strong-dark: rgba(0, 0, 0, 0.5);

  /* Active Theme (defaults to light) */
  --bg-primary: var(--bg-primary-light);
  --bg-secondary: var(--bg-secondary-light);
  --bg-elevated: var(--bg-elevated-light);
  --bg-subtle: var(--bg-subtle-light);

  --text-primary: var(--text-primary-light);
  --text-secondary: var(--text-secondary-light);
  --text-tertiary: var(--text-tertiary-light);
  --text-inverse: var(--text-inverse-light);

  --border: var(--border-light);
  --border-strong: var(--border-strong-light);
  --shadow: var(--shadow-light);
  --shadow-strong: var(--shadow-strong-light);

  /* ===== TYPOGRAPHY ===== */

  /* Font Families */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                  'Roboto', 'Helvetica', 'Arial', sans-serif;
  --font-accent: 'Noto Serif', 'Georgia', serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Font Sizes */
  --font-size-xs: 0.75rem;      /* 12px */
  --font-size-sm: 0.875rem;     /* 14px */
  --font-size-base: 1rem;       /* 16px */
  --font-size-lg: 1.125rem;     /* 18px */
  --font-size-xl: 1.25rem;      /* 20px */
  --font-size-2xl: 1.5rem;      /* 24px */
  --font-size-3xl: 1.875rem;    /* 30px */
  --font-size-4xl: 2.25rem;     /* 36px */
  --font-size-5xl: 3rem;        /* 48px */

  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;

  /* Letter Spacing */
  --letter-spacing-tight: -0.025em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.025em;
  --letter-spacing-wider: 0.05em;

  /* ===== SPACING SYSTEM (8px grid) ===== */

  --space-0: 0;
  --space-1: 0.25rem;    /* 4px */
  --space-2: 0.5rem;     /* 8px */
  --space-3: 0.75rem;    /* 12px */
  --space-4: 1rem;       /* 16px */
  --space-5: 1.25rem;    /* 20px */
  --space-6: 1.5rem;     /* 24px */
  --space-8: 2rem;       /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */

  /* ===== BORDERS ===== */

  --border-width-thin: 1px;
  --border-width-medium: 2px;
  --border-width-thick: 4px;

  --border-radius-sm: 0.25rem;   /* 4px */
  --border-radius-md: 0.5rem;    /* 8px */
  --border-radius-lg: 0.75rem;   /* 12px */
  --border-radius-xl: 1rem;      /* 16px */
  --border-radius-2xl: 1.5rem;   /* 24px */
  --border-radius-full: 9999px;  /* Fully rounded */

  /* ===== SHADOWS ===== */

  --shadow-sm: 0 1px 2px 0 var(--shadow);
  --shadow-md: 0 4px 6px -1px var(--shadow), 0 2px 4px -1px var(--shadow);
  --shadow-lg: 0 10px 15px -3px var(--shadow), 0 4px 6px -2px var(--shadow);
  --shadow-xl: 0 20px 25px -5px var(--shadow), 0 10px 10px -5px var(--shadow);
  --shadow-2xl: 0 25px 50px -12px var(--shadow-strong);

  /* Glow effects for dark mode */
  --glow-primary: 0 0 20px rgba(255, 153, 51, 0.3);
  --glow-accent: 0 0 20px rgba(124, 58, 237, 0.3);
  --glow-gold: 0 0 20px rgba(245, 158, 11, 0.3);

  /* ===== Z-INDEX LAYERS ===== */

  --z-below: -1;
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1100;
  --z-fixed: 1200;
  --z-modal-backdrop: 1300;
  --z-modal: 1400;
  --z-popover: 1500;
  --z-tooltip: 1600;

  /* ===== TRANSITIONS ===== */

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* ===== LAYOUT ===== */

  --container-max-width: 1100px;
  --container-padding: var(--space-4);

  --header-height: 64px;
  --bottom-nav-height: 60px;

  /* ===== BREAKPOINTS (for reference in media queries) ===== */

  /* sm: 640px */
  /* md: 768px */
  /* lg: 1024px */
  /* xl: 1280px */
  /* 2xl: 1536px */
}

/* ============================================================================
   2. DARK MODE
   ============================================================================ */

body.dark-mode {
  --bg-primary: var(--bg-primary-dark);
  --bg-secondary: var(--bg-secondary-dark);
  --bg-elevated: var(--bg-elevated-dark);
  --bg-subtle: var(--bg-subtle-dark);

  --text-primary: var(--text-primary-dark);
  --text-secondary: var(--text-secondary-dark);
  --text-tertiary: var(--text-tertiary-dark);
  --text-inverse: var(--text-inverse-dark);

  --border: var(--border-dark);
  --border-strong: var(--border-strong-dark);
  --shadow: var(--shadow-dark);
  --shadow-strong: var(--shadow-strong-dark);
}

/* Smooth transition between themes */
body {
  transition: background-color var(--transition-base),
              color var(--transition-base);
}

/* ============================================================================
   3. BASE STYLES & RESETS
   ============================================================================ */

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
}

/* Remove default margins */
h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote {
  margin: 0;
  padding: 0;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus styles */
*:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================================================
   4. TYPOGRAPHY SYSTEM
   ============================================================================ */

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

h1 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-6);
}

h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-5);
}

h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-4);
}

h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-3);
}

h5 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-3);
}

h6 {
  font-size: var(--font-size-base);
  margin-bottom: var(--space-2);
}

p {
  margin-bottom: var(--space-4);
  line-height: var(--line-height-relaxed);
}

/* Accent font (for Sanskrit, spiritual terms) */
.text-accent {
  font-family: var(--font-accent);
}

/* Text sizes */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }
.text-4xl { font-size: var(--font-size-4xl); }

/* Text weights */
.font-light { font-weight: var(--font-weight-light); }
.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

/* Text colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-brand { color: var(--color-primary); }
.text-accent-color { color: var(--color-accent); }
.text-gold { color: var(--color-gold); }
.text-benefic { color: var(--color-benefic); }
.text-malefic { color: var(--color-malefic); }
.text-neutral { color: var(--color-neutral); }

/* ============================================================================
   5. LAYOUT COMPONENTS
   ============================================================================ */

/* App Container */
.app-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  width: 100%;
}

/* App Shell */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-shell__header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background-color: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.app-shell__main {
  flex: 1;
  padding: var(--space-6) 0;
}

.app-shell__footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: var(--space-8) 0;
}

/* Section */
.app-section {
  padding: var(--space-8) 0;
}

.app-section--large {
  padding: var(--space-16) 0;
}

.app-section--small {
  padding: var(--space-4) 0;
}

/* Grid System */
.app-grid {
  display: grid;
  gap: var(--space-6);
}

.app-grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.app-grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.app-grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

@media (max-width: 768px) {
  .app-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Flex utilities */
.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(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ============================================================================
   6. CARD COMPONENT
   ============================================================================ */

.app-card {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast);
}

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

.app-card--interactive {
  cursor: pointer;
}

.app-card--interactive:active {
  transform: translateY(0);
}

.app-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.app-card__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.app-card__body {
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
}

.app-card__footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

/* Card variants */
.app-card--elevated {
  box-shadow: var(--shadow-lg);
}

.app-card--bordered {
  border: 2px solid var(--border-strong);
}

.app-card--primary {
  border-color: var(--color-primary);
  background-color: var(--color-primary-subtle);
}

.dark-mode .app-card--primary {
  background-color: rgba(255, 153, 51, 0.1);
}

.app-card--accent {
  border-color: var(--color-accent);
}

/* ============================================================================
   7. BUTTON COMPONENT
   ============================================================================ */

.app-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);

  padding: var(--space-3) var(--space-6);
  min-height: 48px;

  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;

  border: none;
  border-radius: var(--border-radius-lg);
  cursor: pointer;

  transition: all var(--transition-fast);

  /* Prevent text selection */
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.app-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary button */
.app-button--primary {
  background-color: var(--color-primary);
  color: white;
}

.app-button--primary:hover:not(:disabled) {
  background-color: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
}

.dark-mode .app-button--primary:hover:not(:disabled) {
  box-shadow: var(--glow-primary);
}

/* Accent button */
.app-button--accent {
  background-color: var(--color-accent);
  color: white;
}

.app-button--accent:hover:not(:disabled) {
  background-color: var(--color-accent-dark);
  box-shadow: var(--shadow-md);
}

.dark-mode .app-button--accent:hover:not(:disabled) {
  box-shadow: var(--glow-accent);
}

/* Secondary button */
.app-button--secondary {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.app-button--secondary:hover:not(:disabled) {
  background-color: var(--bg-elevated);
  border-color: var(--border-strong);
}

/* Ghost button */
.app-button--ghost {
  background-color: transparent;
  color: var(--text-primary);
}

.app-button--ghost:hover:not(:disabled) {
  background-color: var(--bg-subtle);
}

/* Outline button */
.app-button--outline {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.app-button--outline:hover:not(:disabled) {
  background-color: var(--color-primary);
  color: white;
}

/* Button sizes */
.app-button--small {
  padding: var(--space-2) var(--space-4);
  min-height: 36px;
  font-size: var(--font-size-sm);
}

.app-button--large {
  padding: var(--space-4) var(--space-8);
  min-height: 56px;
  font-size: var(--font-size-lg);
}

/* Icon button */
.app-button--icon {
  padding: var(--space-3);
  min-width: 48px;
  min-height: 48px;
  border-radius: var(--border-radius-full);
}

/* Button group */
.app-button-group {
  display: inline-flex;
  gap: var(--space-2);
}

/* ============================================================================
   8. HEADER COMPONENT
   ============================================================================ */

.app-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
}

.app-header__container {
  max-width: var(--container-max-width);
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  text-decoration: none;
}

.app-header__logo img {
  height: 40px;
  width: auto;
}

.app-header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.app-header__link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: color var(--transition-fast);
}

.app-header__link:hover {
  color: var(--text-primary);
}

.app-header__link--active {
  color: var(--color-primary);
}

/* Theme toggle */
.theme-toggle {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background-color: var(--bg-elevated);
  box-shadow: var(--shadow-md);
}

.theme-toggle__icon {
  font-size: var(--font-size-xl);
}

/* ============================================================================
   9. BOTTOM NAVIGATION (Mobile)
   ============================================================================ */

.app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed);

  height: var(--bottom-nav-height);
  background-color: var(--bg-elevated);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px var(--shadow);

  display: none; /* Hidden on desktop */
}

@media (max-width: 768px) {
  .app-bottom-nav {
    display: flex;
  }

  .app-shell__main {
    padding-bottom: calc(var(--bottom-nav-height) + var(--space-6));
  }
}

.app-bottom-nav__container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  padding: 0 var(--space-2);
}

.app-bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);

  flex: 1;
  min-width: 0;
  padding: var(--space-2);

  color: var(--text-tertiary);
  text-decoration: none;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);

  transition: color var(--transition-fast);
}

.app-bottom-nav__item:hover {
  color: var(--text-secondary);
}

.app-bottom-nav__item--active {
  color: var(--color-primary);
}

.app-bottom-nav__icon {
  font-size: var(--font-size-2xl);
}

/* ============================================================================
   10. FORM COMPONENTS
   ============================================================================ */

.app-form-group {
  margin-bottom: var(--space-6);
}

.app-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
}

.app-input,
.app-select,
.app-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  min-height: 48px;

  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-primary);

  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);

  transition: border-color var(--transition-fast),
              box-shadow var(--transition-fast);
}

.app-input:focus,
.app-select:focus,
.app-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.app-input::placeholder,
.app-textarea::placeholder {
  color: var(--text-tertiary);
}

.app-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Input with icon */
.app-input-wrapper {
  position: relative;
}

.app-input-wrapper__icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.app-input-wrapper .app-input {
  padding-left: var(--space-12);
}

/* ============================================================================
   11. BADGE & TAG COMPONENTS
   ============================================================================ */

.app-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);

  padding: var(--space-1) var(--space-3);

  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: 1;

  border-radius: var(--border-radius-full);
}

.app-badge--primary {
  background-color: var(--color-primary-subtle);
  color: var(--color-primary-dark);
}

.app-badge--success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--color-benefic);
}

.app-badge--error {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--color-malefic);
}

.app-badge--info {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--color-neutral);
}

/* ============================================================================
   12. UTILITY CLASSES
   ============================================================================ */

/* Spacing utilities */
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* Display utilities */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Visibility on mobile */
@media (max-width: 768px) {
  .hide-on-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .show-on-mobile {
    display: none !important;
  }
}

/* ============================================================================
   13. ANIMATIONS & TRANSITIONS
   ============================================================================ */

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

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

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

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

.animate-fade-in {
  animation: fadeIn var(--transition-base) ease-out;
}

.animate-slide-up {
  animation: slideUp var(--transition-slow) ease-out;
}

.animate-slide-down {
  animation: slideDown var(--transition-slow) ease-out;
}

/* ============================================================================
   14. LOADING STATES
   ============================================================================ */

.app-skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-subtle) 0%,
    var(--bg-elevated) 50%,
    var(--bg-subtle) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--border-radius-md);
}

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

.app-skeleton--text {
  height: 1em;
  margin-bottom: var(--space-2);
}

.app-skeleton--card {
  height: 200px;
}

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

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

/* ============================================================================
   15. RESPONSIVE UTILITIES
   ============================================================================ */

/* Mobile-first responsive design */
@media (min-width: 640px) {
  .sm\:text-lg { font-size: var(--font-size-lg); }
  .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .md\:text-xl { font-size: var(--font-size-xl); }
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .md\:flex-row {
    flex-direction: row;
  }
}

@media (min-width: 1024px) {
  .lg\:text-2xl { font-size: var(--font-size-2xl); }
  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================================================
   END OF DESIGN SYSTEM
   ============================================================================ */
