@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* 색상 토큰 (HSL 기반) */
  --primary-hue: 14; /* 따뜻한 오렌지/오토만 브레드 테마 */
  --primary: hsl(var(--primary-hue), 100%, 54%);
  --primary-hover: hsl(var(--primary-hue), 100%, 45%);
  --primary-light: hsl(var(--primary-hue), 100%, 95%);
  
  --success: hsl(145, 63%, 49%);
  --warning: hsl(43, 96%, 56%);
  --danger: hsl(354, 70%, 54%);
  --info: hsl(200, 80%, 50%);

  /* 라이트 테마 변수 (기본) */
  --bg: hsl(210, 20%, 98%);
  --bg-card: hsl(0, 0%, 100%);
  --border: hsl(210, 14%, 90%);
  --text: hsl(210, 24%, 16%);
  --text-muted: hsl(210, 10%, 50%);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.08);

  --font-title: 'Outfit', 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

/* 다크 테마 유틸리티 (필요 시 바디에 .dark-theme 부여) */
body.dark-theme {
  --bg: hsl(220, 20%, 10%);
  --bg-card: hsl(220, 16%, 14%);
  --border: hsl(220, 12%, 20%);
  --text: hsl(210, 15%, 95%);
  --text-muted: hsl(220, 9%, 60%);
  --glass-bg: rgba(20, 24, 33, 0.7);
  --glass-border: rgba(255, 255, 255, 0.06);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 600;
  line-height: 1.25;
}

/* 스크롤바 커스텀 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* 유틸리티 클래스 */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

.shadow-card {
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 87, 34, 0.25);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(255, 87, 34, 0.35);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--border);
  color: var(--text);
}
.btn-secondary:hover {
  background: var(--text-muted);
  color: #fff;
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  filter: brightness(0.9);
  transform: translateY(-2px);
}

/* 애니메이션 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.5; }
  50% { transform: scale(1.05); opacity: 0.8; }
  100% { transform: scale(0.95); opacity: 0.5; }
}

@keyframes vibrate {
  0% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-2px, -2px) rotate(-1deg); }
  20% { transform: translate(2px, 0px) rotate(1deg); }
  30% { transform: translate(0, 2px) rotate(0deg); }
  40% { transform: translate(2px, -2px) rotate(1deg); }
  50% { transform: translate(-2px, 2px) rotate(-1deg); }
  60% { transform: translate(2px, 2px) rotate(0deg); }
  70% { transform: translate(-2px, -2px) rotate(-1deg); }
  80% { transform: translate(2px, 0px) rotate(1deg); }
  90% { transform: translate(0, 2px) rotate(0deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.animate-fade {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.vibrate-active {
  animation: vibrate 0.2s linear infinite;
}
