/* 회의록 작성 서비스 - 공통 스타일시트 */

/* ========== CSS Variables ========== */
:root {
  /* Colors */
  --primary: #0066CC;
  --primary-dark: #004A99;
  --primary-light: #E6F2FF;
  --text-primary: #1A1A1A;
  --text-secondary: #666666;
  --text-disabled: #999999;
  --text-inverse: #FFFFFF;
  --bg-white: #FFFFFF;
  --bg-gray: #F5F5F5;
  --bg-dark: #1A1A1A;
  --success: #0A7029;
  --error: #C41E3A;
  --warning: #856404;
  --info: #0066CC;
  --border-light: #E0E0E0;
  --border-medium: #CCCCCC;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);

  /* Typography */
  --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", monospace;
  --font-xs: 0.75rem;
  --font-sm: 0.875rem;
  --font-base: 1rem;
  --font-lg: 1.125rem;
  --font-xl: 1.25rem;
  --font-2xl: 1.5rem;
  --font-3xl: 2rem;
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Animation */
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-white: #1A1A1A;
    --bg-gray: #2A2A2A;
    --text-primary: #FFFFFF;
    --text-secondary: #CCCCCC;
    --border-light: #404040;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  }
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-gray);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
}

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

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

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

a:hover { color: var(--primary-dark); }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

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

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

@media (min-width: 768px) {
  .container { max-width: 720px; }
}

@media (min-width: 1024px) {
  .container { max-width: 960px; padding: 0 var(--space-8); }
}

.main-content {
  min-height: 100vh;
  padding-bottom: 80px; /* Space for bottom nav on mobile */
}

@media (min-width: 768px) {
  .main-content { padding-bottom: 0; }
}

/* ========== Header ========== */
.header {
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-title {
  font-size: var(--font-lg);
  font-weight: var(--font-semibold);
  margin: 0;
}

.header-back {
  background: none;
  border: none;
  font-size: var(--font-2xl);
  color: var(--text-primary);
  cursor: pointer;
  padding: var(--space-2);
}

.header-actions {
  display: flex;
  gap: var(--space-2);
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: var(--font-semibold);
  font-size: var(--font-sm);
  transition: all var(--duration-base) var(--ease-in-out);
  cursor: pointer;
  border: none;
  text-decoration: none;
  min-height: 44px;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 10px 22px;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--primary-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-gray);
}

.btn-success {
  background: var(--success);
  color: var(--text-inverse);
}

.btn-error {
  background: var(--error);
  color: var(--text-inverse);
}

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

.btn-full {
  width: 100%;
}

.btn-icon {
  padding: var(--space-3);
  border-radius: 50%;
  min-height: 44px;
  min-width: 44px;
}

/* ========== Form Elements ========== */
.form-group {
  margin-bottom: var(--space-6);
}

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

.required {
  color: var(--error);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: var(--font-sm);
  background: var(--bg-white);
  color: var(--text-primary);
  transition: border-color var(--duration-base);
  min-height: 44px;
}

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

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

.form-input:disabled,
.form-textarea:disabled,
.form-select:disabled {
  background: var(--bg-gray);
  cursor: not-allowed;
}

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

.form-error {
  display: none;
  color: var(--error);
  font-size: var(--font-xs);
  margin-top: var(--space-2);
}

.form-group.has-error .form-error {
  display: block;
}

.form-hint {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  margin-top: var(--space-2);
}

/* ========== Cards ========== */
.card {
  background: var(--bg-white);
  border-radius: 12px;
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-base);
}

.card-hover {
  cursor: pointer;
}

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

.card-title {
  font-size: var(--font-lg);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-3);
}

.card-subtitle {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

/* ========== Badge & Chip ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: var(--font-xs);
  font-weight: var(--font-medium);
}

.badge-success {
  background: var(--success);
  color: var(--text-inverse);
}

.badge-error {
  background: var(--error);
  color: var(--text-inverse);
}

.badge-warning {
  background: var(--warning);
  color: var(--text-inverse);
}

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

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--bg-gray);
  font-size: var(--font-sm);
  gap: var(--space-2);
}

.chip-remove {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: var(--font-lg);
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-dark);
  color: var(--text-inverse);
  padding: var(--space-4) var(--space-6);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: slideUp var(--duration-slow) var(--ease-in-out);
}

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

.toast-success { background: var(--success); }
.toast-error { background: var(--error); }
.toast-warning { background: var(--warning); }

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-4);
}

.modal {
  background: var(--bg-white);
  border-radius: 12px;
  padding: var(--space-6);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-title {
  font-size: var(--font-xl);
  font-weight: var(--font-semibold);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: var(--font-2xl);
  color: var(--text-secondary);
  cursor: pointer;
}

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

/* ========== Loading ========== */
.loading {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

/* ========== Bottom Navigation (Mobile) ========== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-white);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-around;
  padding: var(--space-2) 0;
  z-index: 100;
}

@media (min-width: 768px) {
  .bottom-nav { display: none; }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-2);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--font-xs);
  min-width: 60px;
  transition: color var(--duration-base);
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-icon {
  font-size: var(--font-2xl);
  margin-bottom: var(--space-1);
}

/* ========== FAB (Floating Action Button) ========== */
.fab {
  position: fixed;
  bottom: 100px;
  right: var(--space-4);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--text-inverse);
  font-size: var(--font-2xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: all var(--duration-base);
  z-index: 50;
}

.fab:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

@media (min-width: 768px) {
  .fab {
    bottom: var(--space-6);
  }
}

/* ========== Avatar ========== */
.avatar {
  display: inline-block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-semibold);
  font-size: var(--font-sm);
}

.avatar-sm { width: 32px; height: 32px; font-size: var(--font-xs); }
.avatar-lg { width: 56px; height: 56px; font-size: var(--font-lg); }

.avatar-group {
  display: flex;
  align-items: center;
}

.avatar-group .avatar {
  margin-left: -8px;
  border: 2px solid var(--bg-white);
}

.avatar-group .avatar:first-child {
  margin-left: 0;
}

/* ========== Empty State ========== */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state-title {
  font-size: var(--font-xl);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state-description {
  font-size: var(--font-sm);
  margin-bottom: var(--space-6);
}

/* ========== Accessibility ========== */
.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;
}

*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== Utility Classes ========== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }

.mt-0 { margin-top: 0; }
.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-0 { margin-bottom: 0; }
.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); }

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