/*
 * 회의록 작성 및 공유 개선 서비스 - 공통 스타일시트
 * 버전: 1.0
 * 작성일: 2025-10-20
 * 설계 철학: Mobile First 디자인
 * 접근성 기준: WCAG 2.1 Level AA
 */

/* ==================== CSS Variables ==================== */
:root {
  /* 컬러 - Primary (청록색) */
  --primary-50: #ECFDF5;
  --primary-100: #D1FAE5;
  --primary-200: #A7F3D0;
  --primary-500: #00C896;
  --primary-600: #00B589;
  --primary-700: #00A07C;
  --primary-900: #00725C;

  /* 컬러 - Gray (회색 스케일) */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* 컬러 - Semantic (의미 색상) */
  --success-50: #ECFDF5;
  --success-100: #D1FAE5;
  --success-500: #10B981;
  --success-700: #047857;

  --warning-50: #FFFBEB;
  --warning-100: #FEF3C7;
  --warning-500: #F59E0B;
  --warning-700: #B45309;

  --error-50: #FEF2F2;
  --error-100: #FEE2E2;
  --error-500: #EF4444;
  --error-700: #B91C1C;

  --info-50: #EFF6FF;
  --info-100: #DBEAFE;
  --info-500: #3B82F6;
  --info-700: #1D4ED8;

  /* 배경 색상 */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F9FAFB;
  --bg-tertiary: #F3F4F6;
  --bg-dark: #111827;

  /* 텍스트 색상 */
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  --text-disabled: #D1D5DB;
  --text-inverse: #FFFFFF;

  /* 폰트 패밀리 */
  --font-primary: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Consolas', 'Liberation Mono', monospace;

  /* 간격 시스템 (8px 기반 그리드) */
  --space-0: 0px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Border Radius */
  --radius-none: 0px;
  --radius-small: 4px;
  --radius-medium: 8px;
  --radius-large: 12px;
  --radius-xlarge: 16px;
  --radius-full: 9999px;

  /* Border Width */
  --border-thin: 1px;
  --border-medium: 2px;
  --border-thick: 4px;

  /* 애니메이션 지속 시간 */
  --duration-instant: 100ms;
  --duration-fast: 150ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
  --duration-slower: 500ms;

  /* 아이콘 크기 */
  --icon-small: 16px;
  --icon-medium: 20px;
  --icon-large: 24px;
  --icon-xlarge: 32px;
}

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

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

body {
  font-family: var(--font-primary);
  font-size: 0.875rem; /* 14px */
  line-height: 1.5;
  color: var(--text-secondary);
  background-color: var(--bg-secondary);
  min-height: 100vh;
}

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

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

ul, ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

/* ==================== Typography ==================== */
/* Mobile First */
h1, .h1 {
  font-size: 1.5rem; /* 24px */
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

h2, .h2 {
  font-size: 1.25rem; /* 20px */
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}

h3, .h3 {
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}

h4, .h4 {
  font-size: 1rem; /* 16px */
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}

.text-body {
  font-size: 0.875rem; /* 14px */
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-secondary);
}

.text-caption {
  font-size: 0.75rem; /* 12px */
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
}

.text-small {
  font-size: 0.6875rem; /* 11px */
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-tertiary);
}

/* Tablet */
@media (min-width: 768px) {
  h1, .h1 { font-size: 1.75rem; /* 28px */ }
  h2, .h2 { font-size: 1.375rem; /* 22px */ }
  h3, .h3 { font-size: 1.25rem; /* 20px */ }
  h4, .h4 { font-size: 1.125rem; /* 18px */ }
  .text-body { font-size: 1rem; /* 16px */ }
  .text-caption { font-size: 0.875rem; /* 14px */ }
  .text-small { font-size: 0.75rem; /* 12px */ }
}

/* Desktop */
@media (min-width: 1024px) {
  h1, .h1 { font-size: 2rem; /* 32px */ }
  h2, .h2 { font-size: 1.5rem; /* 24px */ }
}

/* Display (Desktop only) */
@media (min-width: 1024px) {
  .display {
    font-size: 2.5rem; /* 40px */
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--text-primary);
  }
}

@media (min-width: 1440px) {
  .display {
    font-size: 3rem; /* 48px */
  }
}

/* ==================== Button Components ==================== */
/* Base Button */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-weight: 600;
  border-radius: var(--radius-small);
  transition: all var(--duration-instant) ease-in-out;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}

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

/* Primary Button */
.button-primary {
  background-color: var(--primary-500);
  color: var(--text-inverse);
  border: none;
  font-size: 0.875rem; /* 14px */
  padding: var(--space-3) var(--space-4); /* 12px 16px */
}

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

.button-primary:active:not(:disabled) {
  background-color: var(--primary-700);
}

.button-primary:disabled {
  background-color: var(--gray-300);
  color: var(--text-disabled);
}

/* Secondary Button */
.button-secondary {
  background-color: var(--gray-50);
  color: var(--text-secondary);
  border: var(--border-thin) solid var(--gray-200);
  font-size: 0.875rem; /* 14px */
  padding: var(--space-3) var(--space-4); /* 12px 16px */
}

.button-secondary:hover:not(:disabled) {
  background-color: var(--gray-100);
  border-color: var(--gray-300);
}

.button-secondary:active:not(:disabled) {
  background-color: var(--gray-200);
}

/* Outline Button */
.button-outline {
  background-color: transparent;
  color: var(--primary-500);
  border: var(--border-thin) solid var(--primary-500);
  font-size: 0.875rem; /* 14px */
  padding: var(--space-3) var(--space-4); /* 12px 16px */
}

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

.button-outline:active:not(:disabled) {
  background-color: var(--primary-100);
}

/* Ghost Button */
.button-ghost {
  background-color: transparent;
  color: var(--text-secondary);
  border: none;
  font-size: 0.875rem; /* 14px */
  padding: var(--space-3) var(--space-4); /* 12px 16px */
}

.button-ghost:hover:not(:disabled) {
  background-color: var(--gray-50);
}

.button-ghost:active:not(:disabled) {
  background-color: var(--gray-100);
}

/* Button Sizes */
.button-small {
  height: 32px;
  padding: var(--space-2) var(--space-3); /* 8px 12px */
  font-size: 0.75rem; /* 12px */
}

.button-medium {
  height: 40px;
  padding: var(--space-3) var(--space-4); /* 12px 16px */
  font-size: 0.875rem; /* 14px */
}

.button-large {
  height: 48px;
  padding: var(--space-4) var(--space-6); /* 16px 24px */
  font-size: 1rem; /* 16px */
}

/* Icon Button */
.button-icon {
  width: 44px;
  height: 44px;
  padding: var(--space-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==================== Input Field ==================== */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-label {
  display: block;
  font-size: 0.875rem; /* 14px */
  font-weight: 500;
  color: var(--gray-700);
}

.input-label.required::after {
  content: ' *';
  color: var(--error-500);
}

.input-field {
  width: 100%;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border: var(--border-thin) solid var(--gray-200);
  border-radius: var(--radius-small);
  font-size: 0.875rem; /* 14px */
  height: 40px;
  padding: 0 var(--space-4);
  transition: border-color var(--duration-fast) ease-in-out;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.1);
}

.input-field:disabled {
  background-color: var(--bg-secondary);
  color: var(--text-disabled);
  cursor: not-allowed;
}

.input-field.error {
  border-color: var(--error-500);
}

.input-field::placeholder {
  color: var(--text-tertiary);
}

.input-error-message {
  font-size: 0.75rem; /* 12px */
  color: var(--error-500);
  margin-top: var(--space-1);
}

/* Textarea */
textarea.input-field {
  height: auto;
  min-height: 80px;
  padding: var(--space-3) var(--space-4);
  resize: vertical;
}

/* ==================== Card Component ==================== */
.card {
  background-color: var(--bg-primary);
  border: var(--border-thin) solid var(--gray-200);
  border-radius: var(--radius-medium);
  padding: var(--space-4); /* 16px - Mobile */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all var(--duration-fast) ease-in-out;
}

@media (min-width: 768px) {
  .card {
    padding: var(--space-5); /* 20px - Tablet/Desktop */
  }
}

.card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-clickable {
  cursor: pointer;
}

.card-clickable:hover {
  border-color: var(--primary-500);
}

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

.card-title {
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  color: var(--text-secondary);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: var(--border-thin) solid var(--gray-200);
}

/* ==================== Modal Component ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fade-in var(--duration-fast) ease-out;
}

.modal {
  background-color: var(--bg-primary);
  border-radius: var(--radius-large);
  padding: var(--space-6);
  width: 90%; /* Mobile */
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
  animation: slide-up var(--duration-normal) ease-out;
}

@media (min-width: 768px) {
  .modal {
    width: auto;
    max-width: 600px;
  }
}

@media (min-width: 1024px) {
  .modal {
    max-width: 800px;
  }
}

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

.modal-title {
  font-size: 1.25rem; /* 20px */
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem; /* 24px */
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--duration-instant) ease-in-out;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  color: var(--text-secondary);
}

.modal-footer {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-top: var(--space-6);
}

/* ==================== Badge Component ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.75rem; /* 12px */
  font-weight: 500;
  padding: var(--space-1) var(--space-2); /* 4px 8px */
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-verified {
  background-color: var(--success-50);
  color: var(--success-700);
}

.badge-pending {
  background-color: var(--warning-50);
  color: var(--warning-700);
}

.badge-in-progress {
  background-color: var(--info-50);
  color: var(--info-700);
}

.badge-confirmed {
  background-color: var(--success-50);
  color: var(--success-700);
  border: var(--border-thin) solid var(--success-500);
}

.badge-error {
  background-color: var(--error-50);
  color: var(--error-700);
}

/* ==================== Progress Bar ==================== */
.progress-bar {
  width: 100%;
  height: 4px;
  background-color: var(--gray-200);
  border-radius: var(--radius-small);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--primary-500);
  transition: width var(--duration-slow) ease-out;
}

.progress-fill.success {
  background-color: var(--success-500);
}

.progress-fill.warning {
  background-color: var(--warning-500);
}

.progress-fill.error {
  background-color: var(--error-500);
}

/* ==================== Spinner ==================== */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-small {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.spinner-large {
  width: 32px;
  height: 32px;
  border-width: 4px;
}

/* ==================== Skeleton Loading ==================== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-50) 25%,
    var(--gray-100) 50%,
    var(--gray-50) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-small);
}

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

.skeleton-title {
  height: 1.5rem;
  width: 60%;
  margin-bottom: var(--space-3);
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

/* ==================== Toast Component ==================== */
.toast {
  position: fixed;
  bottom: 20px; /* Mobile */
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--gray-900);
  color: var(--text-inverse);
  padding: var(--space-3) var(--space-4); /* 12px 16px */
  border-radius: var(--radius-medium);
  font-size: 0.875rem; /* 14px */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  animation: toast-in var(--duration-fast) ease-out;
  min-width: 280px;
  max-width: 90vw;
}

@media (min-width: 1024px) {
  .toast {
    bottom: auto;
    top: 20px;
    right: 20px;
    left: auto;
    transform: none;
  }
}

.toast-success {
  background-color: var(--success-500);
}

.toast-error {
  background-color: var(--error-500);
}

.toast-info {
  background-color: var(--info-500);
}

.toast-warning {
  background-color: var(--warning-500);
}

/* ==================== Todo Card Component ==================== */
.todo-card {
  background-color: var(--bg-primary);
  border: var(--border-thin) solid var(--gray-200);
  border-left: var(--border-thick) solid var(--gray-500);
  border-radius: var(--radius-medium);
  padding: var(--space-3); /* 12px */
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  transition: all var(--duration-fast) ease-in-out;
}

.todo-card:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.todo-card.priority-high {
  border-left-color: var(--error-500);
}

.todo-card.priority-medium {
  border-left-color: var(--warning-500);
}

.todo-card.priority-low {
  border-left-color: var(--success-500);
}

.todo-checkbox {
  width: 20px;
  height: 20px;
  border: var(--border-medium) solid var(--gray-300);
  border-radius: var(--radius-small);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--duration-instant) ease-in-out;
}

.todo-checkbox.checked {
  background-color: var(--success-500);
  border-color: var(--success-500);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
}

.todo-content {
  flex: 1;
}

.todo-title {
  font-size: 0.875rem; /* 14px */
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.todo-title.completed {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.todo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: 0.75rem; /* 12px */
  color: var(--text-secondary);
}

.todo-assignee,
.todo-duedate {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.todo-duedate.urgent {
  color: var(--error-500);
  font-weight: 600;
}

.todo-meeting-link {
  font-size: 0.75rem; /* 12px */
  color: var(--primary-500);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-2);
}

.todo-meeting-link:hover {
  text-decoration: underline;
}

/* ==================== Voice Recording UI ==================== */
.voice-recording {
  background-color: var(--bg-secondary);
  border: var(--border-thin) solid var(--gray-200);
  border-radius: var(--radius-medium);
  padding: var(--space-4); /* 16px */
  height: 80px; /* Mobile */
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

@media (min-width: 1024px) {
  .voice-recording {
    height: 100px; /* Desktop */
  }
}

.recording-indicator {
  width: 12px;
  height: 12px;
  background-color: var(--error-500);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

.recording-timer {
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  min-width: 60px;
}

.waveform {
  flex: 1;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.waveform-bar {
  width: 3px;
  background-color: var(--primary-500);
  border-radius: 2px;
  animation: wave 1s ease-in-out infinite;
}

.waveform-bar:nth-child(1) { animation-delay: 0s; }
.waveform-bar:nth-child(2) { animation-delay: 0.1s; }
.waveform-bar:nth-child(3) { animation-delay: 0.2s; }
.waveform-bar:nth-child(4) { animation-delay: 0.3s; }
.waveform-bar:nth-child(5) { animation-delay: 0.4s; }

/* ==================== Realtime Text Display ==================== */
.realtime-text {
  background-color: var(--bg-primary);
  border: var(--border-thin) solid var(--gray-200);
  border-radius: var(--radius-medium);
  padding: var(--space-3); /* 12px */
  margin-bottom: var(--space-2);
}

.speaker-name {
  display: inline-block;
  font-size: 0.75rem; /* 12px */
  font-weight: 600;
  color: var(--primary-700);
  background-color: var(--primary-50);
  padding: var(--space-1) var(--space-2); /* 2px 8px */
  border-radius: var(--radius-small);
  margin-bottom: var(--space-1);
}

.timestamp {
  font-size: 0.75rem; /* 12px */
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  margin-left: var(--space-2);
}

.text-content {
  font-size: 0.875rem; /* 14px */
  line-height: 1.75;
  color: var(--gray-700);
}

.typing-indicator {
  display: inline-block;
  width: 4px;
  height: 16px;
  background-color: var(--primary-500);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

/* ==================== Term Tooltip ==================== */
.term-highlight {
  color: var(--primary-500);
  border-bottom: var(--border-thin) dashed var(--primary-500);
  cursor: help;
  transition: color var(--duration-instant) ease-in-out;
}

.term-highlight:hover {
  color: var(--primary-700);
}

.tooltip {
  position: absolute;
  background-color: var(--bg-primary);
  border: var(--border-thin) solid var(--gray-200);
  border-radius: var(--radius-medium);
  padding: var(--space-4); /* 16px */
  width: 320px; /* Mobile */
  max-width: 90vw;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
  z-index: 100;
  animation: fade-in var(--duration-fast) ease-out;
}

@media (min-width: 1024px) {
  .tooltip {
    width: 400px; /* Desktop */
  }
}

.tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 20px;
  border: 8px solid transparent;
  border-bottom-color: var(--gray-200);
}

.tooltip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 21px;
  border: 7px solid transparent;
  border-bottom-color: var(--bg-primary);
}

.tooltip-section {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: var(--border-thin) solid var(--gray-200);
}

.tooltip-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.tooltip-title {
  font-size: 0.75rem; /* 12px */
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tooltip-content {
  font-size: 0.875rem; /* 14px */
  line-height: 1.5;
  color: var(--gray-700);
}

/* ==================== Accessibility ==================== */
/* Focus Visible */
*:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* Skip to Main Content */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-500);
  color: white;
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  z-index: 100;
}

.skip-to-main:focus {
  top: 0;
}

/* Screen Reader Only */
.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;
}

/* ==================== Animations ==================== */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

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

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

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

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

@keyframes wave {
  0%, 100% {
    height: 10px;
  }
  50% {
    height: 40px;
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@media (min-width: 1024px) {
  @keyframes toast-in {
    from {
      opacity: 0;
      transform: translateX(20px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
}

@keyframes highlight-fade {
  0% {
    background-color: var(--warning-100);
  }
  100% {
    background-color: transparent;
  }
}

/* ==================== Utility Classes ==================== */
/* Margin */
.m-0 { margin: 0; }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-5 { margin: var(--space-5); }
.m-6 { margin: var(--space-6); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.ml-0 { margin-left: 0; }
.ml-1 { margin-left: var(--space-1); }
.ml-2 { margin-left: var(--space-2); }
.ml-3 { margin-left: var(--space-3); }
.ml-4 { margin-left: var(--space-4); }

.mr-0 { margin-right: 0; }
.mr-1 { margin-right: var(--space-1); }
.mr-2 { margin-right: var(--space-2); }
.mr-3 { margin-right: var(--space-3); }
.mr-4 { margin-right: var(--space-4); }

/* Padding */
.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: var(--space-1); }
.pt-2 { padding-top: var(--space-2); }
.pt-3 { padding-top: var(--space-3); }
.pt-4 { padding-top: var(--space-4); }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: var(--space-1); }
.pb-2 { padding-bottom: var(--space-2); }
.pb-3 { padding-bottom: var(--space-3); }
.pb-4 { padding-bottom: var(--space-4); }

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

/* Display */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }

/* Flexbox */
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.align-start { align-items: flex-start; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.align-stretch { align-items: stretch; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* Colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-inverse { color: var(--text-inverse); }

.bg-primary { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }

/* ==================== Responsive Container ==================== */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4); /* 16px - Mobile */
  padding-right: var(--space-4);
}

@media (min-width: 768px) {
  .container {
    padding-left: var(--space-6); /* 24px - Tablet */
    padding-right: var(--space-6);
  }
}

@media (min-width: 1024px) {
  .container {
    padding-left: var(--space-8); /* 32px - Desktop */
    padding-right: var(--space-8);
    max-width: 1440px;
  }
}

/* ==================== Responsive Utilities ==================== */
/* Mobile Only */
@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
}

/* Tablet and Up */
@media (min-width: 768px) {
  .hide-tablet { display: none !important; }
  .show-mobile { display: none !important; }
}

/* Desktop Only */
@media (min-width: 1024px) {
  .hide-desktop { display: none !important; }
  .show-tablet { display: none !important; }
}
