/* ============================================
   회의록 작성 및 공유 개선 서비스 - 공통 스타일
   ============================================ */

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

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

body {
  font-family: 'Pretendard', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
  line-height: 1.5;
  color: #4B5563;
  background-color: #F9FAFB;
}

/* === CSS Variables === */
:root {
  /* Primary Colors */
  --primary-light: #4DFFDB;
  --primary-main: #00D9B1;
  --primary-dark: #00A88A;

  /* Secondary Colors */
  --secondary-light: #A5B4FC;
  --secondary-main: #6366F1;
  --secondary-dark: #4F46E5;

  /* Semantic Colors */
  --success-light: #6EE7B7;
  --success-main: #10B981;
  --success-dark: #059669;

  --warning-light: #FCD34D;
  --warning-main: #F59E0B;
  --warning-dark: #D97706;

  --error-light: #FCA5A5;
  --error-main: #EF4444;
  --error-dark: #DC2626;

  --info-light: #93C5FD;
  --info-main: #3B82F6;
  --info-dark: #2563EB;

  /* Neutral Colors */
  --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;

  /* Typography */
  --font-display: 700 3rem/1.25 'Pretendard';
  --font-h1: 700 2.25rem/1.25 'Pretendard';
  --font-h2: 600 1.875rem/1.25 'Pretendard';
  --font-h3: 600 1.5rem/1.5 'Pretendard';
  --font-h4: 600 1.25rem/1.5 'Pretendard';
  --font-body-large: 400 1.125rem/1.5 'Pretendard';
  --font-body: 400 1rem/1.5 'Pretendard';
  --font-body-small: 400 0.875rem/1.5 'Pretendard';
  --font-caption: 400 0.75rem/1.5 'Pretendard';

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

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease-out;
  --transition-base: 200ms ease-out;
  --transition-slow: 300ms ease-out;
}

/* === Typography === */
h1 { font: var(--font-h1); color: var(--gray-900); }
h2 { font: var(--font-h2); color: var(--gray-900); }
h3 { font: var(--font-h3); color: var(--gray-900); }
h4 { font: var(--font-h4); color: var(--gray-900); }
p { font: var(--font-body); margin-bottom: var(--spacing-4); }
small { font: var(--font-caption); color: var(--gray-500); }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-3) var(--spacing-6);
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  gap: var(--spacing-2);
}

.btn-primary {
  background-color: var(--primary-main);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-primary:active {
  background-color: var(--primary-dark);
  transform: scale(0.98);
}

.btn-primary:disabled {
  background-color: var(--gray-300);
  color: var(--gray-500);
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-main);
  border: 1px solid var(--primary-main);
}

.btn-secondary:hover {
  background-color: rgba(0, 217, 177, 0.1);
}

.btn-secondary:active {
  background-color: rgba(0, 217, 177, 0.2);
}

.btn-text {
  background-color: transparent;
  color: var(--gray-700);
}

.btn-text:hover {
  background-color: var(--gray-100);
}

.btn-text:active {
  background-color: var(--gray-200);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
  background-color: transparent;
}

.btn-icon:hover {
  background-color: var(--gray-100);
}

.btn-sm {
  padding: var(--spacing-2) var(--spacing-4);
  font-size: 0.875rem;
}

.btn-lg {
  padding: var(--spacing-4) var(--spacing-8);
  font-size: 1.125rem;
}

/* FAB (Floating Action Button) */
.fab {
  position: fixed;
  bottom: var(--spacing-4);
  right: var(--spacing-4);
  width: 56px;
  height: 56px;
  background-color: var(--primary-main);
  color: white;
  border-radius: var(--radius-full);
  border: none;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 1000;
}

.fab:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.fab:active {
  transform: scale(0.95);
}

/* === Input Fields === */
.input,
.textarea,
.select {
  width: 100%;
  padding: var(--spacing-3) var(--spacing-4);
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background-color: white;
  transition: all var(--transition-fast);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: 4px solid rgba(0, 217, 177, 0.2);
  border-color: var(--primary-main);
  border-width: 2px;
}

.input.error,
.textarea.error {
  border-color: var(--error-main);
}

.input:disabled,
.textarea:disabled,
.select:disabled {
  background-color: var(--gray-100);
  color: var(--gray-400);
  cursor: not-allowed;
}

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

.input-group {
  margin-bottom: var(--spacing-4);
}

.input-label {
  display: block;
  margin-bottom: var(--spacing-2);
  font-weight: 500;
  color: var(--gray-700);
}

.input-error {
  display: block;
  margin-top: var(--spacing-1);
  font-size: 0.875rem;
  color: var(--error-main);
}

/* === Cards === */
.card {
  background-color: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--spacing-6);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.card.interactive {
  cursor: pointer;
}

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

.card.interactive:active {
  box-shadow: var(--shadow-sm);
  transform: scale(0.99);
}

/* === Badges === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-1) var(--spacing-3);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-full);
}

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

.badge-success {
  background-color: var(--success-light);
  color: var(--success-dark);
}

.badge-warning {
  background-color: var(--warning-light);
  color: var(--warning-dark);
}

.badge-error {
  background-color: var(--error-light);
  color: var(--error-dark);
}

.badge-neutral {
  background-color: var(--gray-200);
  color: var(--gray-700);
}

/* === Modal === */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  background-color: white;
  border-radius: var(--radius-xl);
  padding: var(--spacing-8);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  margin-bottom: var(--spacing-6);
}

.modal-title {
  font: var(--font-h3);
  color: var(--gray-900);
}

.modal-body {
  margin-bottom: var(--spacing-8);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-3);
}

/* === Toast === */
.toast-container {
  position: fixed;
  top: var(--spacing-4);
  right: var(--spacing-4);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
}

.toast {
  background-color: white;
  border-radius: var(--radius-md);
  padding: var(--spacing-4) var(--spacing-5);
  max-width: 400px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  border-left: 4px solid;
  animation: slideIn 200ms ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-success {
  border-left-color: var(--success-main);
}

.toast-error {
  border-left-color: var(--error-main);
}

.toast-warning {
  border-left-color: var(--warning-main);
}

.toast-info {
  border-left-color: var(--info-main);
}

/* === Layout === */
.container {
  max-width: 1536px;
  margin: 0 auto;
  padding: 0 var(--spacing-6);
}

.header {
  background-color: white;
  border-bottom: 1px solid var(--gray-200);
  padding: var(--spacing-4) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-main);
  text-decoration: none;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 250px;
  height: 100vh;
  background-color: white;
  border-right: 1px solid var(--gray-200);
  padding: var(--spacing-6);
  overflow-y: auto;
}

.main-content {
  margin-left: 250px;
  padding: var(--spacing-8);
  min-height: 100vh;
}

/* === Grid System === */
.grid {
  display: grid;
  gap: var(--spacing-4);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* === Utility Classes === */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-2 { margin-top: var(--spacing-2); }
.mt-4 { margin-top: var(--spacing-4); }
.mt-6 { margin-top: var(--spacing-6); }
.mt-8 { margin-top: var(--spacing-8); }

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

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 { gap: var(--spacing-2); }
.gap-4 { gap: var(--spacing-4); }
.gap-6 { gap: var(--spacing-6); }

/* === Responsive === */
@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 300ms ease-out;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .container {
    padding: 0 var(--spacing-4);
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .modal {
    width: 95%;
    padding: var(--spacing-6);
  }
}
