/* ========================================
   Harudown Design System
   Shared styles for all web pages
   Mirrors Flutter app theme (Material 3)
   ======================================== */

/* ── Web Font ── */
@font-face {
  font-family: 'Pretendard';
  src: url('../fonts/pretendard/Pretendard-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Pretendard';
  src: url('../fonts/pretendard/Pretendard-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Pretendard';
  src: url('../fonts/pretendard/Pretendard-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Pretendard';
  src: url('../fonts/pretendard/Pretendard-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Pretendard';
  src: url('../fonts/pretendard/Pretendard-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ── CSS Variables ── */
:root {
  /* ─ Primary ─ */
  --primary: #3478F6;
  --primary-light: #5B9CF6;
  --primary-dark: #1A5BC7;
  --primary-tint: #EBF2FF;
  --on-primary: #FFFFFF;

  /* ─ Semantic ─ */
  --info: #3478F6;
  --success-1: #34C759;
  --success-2: #30A14E;
  --success-tint: #E4F3E5;
  --warning: #FF9F0A;
  --error: #FF3B30;
  --on-error: #FFFFFF;
  --error-container: #FFE5E8;

  /* ─ Neutral / Grey ─ */
  --grey-1: #6E6E73;
  --grey-2: #8E8E93;
  --grey-3: #C7C7CC;

  /* ─ Surfaces ─ */
  --surface: #FFFFFF;
  --surface-dim: #E5E5EA;
  --surface-bright: #FDFDFD;
  --surface-1: #8E8E93;
  --surface-3: #E5E5EA;
  --surface-4: #F2F2F7;
  --surface-7: #2C2C2E;
  --surface-container-lowest: #FFFFFF;
  --surface-container-low: #F8F8FA;
  --surface-container: #F2F2F7;
  --surface-container-high: #E5E5EA;
  --surface-container-highest: #DDDDE0;
  --on-surface: #1C1C1E;

  /* ─ Lines & Borders ─ */
  --line-2: #8E8E93;
  --line-3: #C7C7CC;
  --line-4: #D1D1D6;
  --divider: #E5E5EA;
  --handle: #D1D1D6;

  /* ─ Shadows ─ */
  --card-shadow: 0 1px 4px rgba(15, 20, 33, 0.08);
  --card-elevation: 0 1px 4px rgba(20, 20, 33, 0.06);
  --bottom-bar-shadow: 0 -1px 4px rgba(20, 20, 33, 0.04);

  /* ─ Inverse ─ */
  --inverse-surface: #2C2C2E;
  --on-inverse-surface: #F1F1F1;

  /* ─ Outline ─ */
  --outline: #8E8E93;
  --outline-variant: #D1D1D6;

  /* ─ Category Colors ─ */
  --cat-restaurant: #FFC107;
  --cat-cafe: #9747FF;
  --cat-sightseeing: #2BBA70;
  --cat-accommodation: #D62B2B;
  --cat-shopping: #E53573;
  --cat-nature: #2BBA70;
  --cat-culture: #2BBA70;
  --cat-entertainment: #E53573;
  --cat-other: #1A1A1A;

  /* ─ Typography ─ */
  --font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --text-color: #1C1C1E;

  /* ─ Spacing ─ */
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 20px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 48px;
  --space-4xl: 64px;
  --space-5xl: 96px;

  /* ─ Radius ─ */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-pill: 999px;

  /* ─ Marketing shadows ─ */
  --shadow-sm: 0 1px 4px rgba(20, 20, 33, 0.06);
  --shadow-md: 0 6px 18px rgba(20, 20, 33, 0.08);
  --shadow-lg: 0 18px 34px rgba(20, 20, 33, 0.13);
  --shadow-xl: 0 25px 50px rgba(20, 20, 33, 0.18);

  /* ─ Page max-width ─ */
  --landing-max: 1180px;
  --landing-px: 24px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  color: var(--text-color);
  background-color: var(--surface-container);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  min-height: 100dvh;
}

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

img {
  display: block;
  max-width: 100%;
}

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

ul, ol {
  list-style: none;
}

/* ── Typography Classes ── */
.text-title1 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.33;
  letter-spacing: -0.4px;
}

.text-title2 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.375;
  letter-spacing: -0.3px;
}

.text-title3 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.43;
  letter-spacing: -0.2px;
}

.text-subtitle1 {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.54;
  letter-spacing: -0.2px;
}

.text-subtitle2 {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.15px;
}

.text-body1 {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.43;
  letter-spacing: -0.2px;
}

.text-body2 {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.54;
  letter-spacing: -0.2px;
}

.text-body3 {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.15px;
}

.text-caption {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.1px;
}

.text-overline {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
}

/* ── Color Utilities ── */
.text-primary { color: var(--primary); }
.text-grey1 { color: var(--grey-1); }
.text-grey2 { color: var(--grey-2); }
.text-grey3 { color: var(--grey-3); }
.text-error { color: var(--error); }
.text-success { color: var(--success-1); }

/* ── Layout ── */
.page-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 12px 40px;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background-color: var(--divider);
}

/* ── Avatar ── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--surface-container);
  flex-shrink: 0;
}

.avatar-sm {
  width: 30px;
  height: 30px;
}

.avatar-md {
  width: 60px;
  height: 60px;
}

.avatar-lg {
  width: 90px;
  height: 90px;
}

/* ── Overlapped Avatars ── */
.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack .avatar:not(:first-child) {
  margin-left: -10px;
}

.avatar-stack .avatar {
  border: 1.5px solid var(--divider);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.54;
  letter-spacing: -0.2px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, background-color 0.15s;
  text-decoration: none;
}

.btn:active {
  opacity: 0.8;
}

/* Filled (primary background) */
.btn-elevated {
  padding: 10px 20px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--on-primary);
}

.btn-elevated:hover {
  background: var(--primary-dark);
}

/* Filled (surface background) */
.btn-filled {
  min-width: 40px;
  min-height: 40px;
  padding: 8px;
  border-radius: 12px;
  background: var(--surface-4);
  color: var(--primary);
}

.btn-filled:hover {
  background: var(--surface-3);
}

/* Outlined */
.btn-outlined {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-color);
  border: 1px solid var(--line-4);
}

.btn-outlined:hover {
  background: var(--surface-4);
}

/* Text Button */
.btn-text {
  padding: 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--primary);
}

.btn-text:hover {
  background: var(--surface-4);
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.15px;
}

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

.badge-success {
  background-color: var(--success-tint);
  color: var(--success-2);
}

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

.badge-neutral {
  background-color: var(--surface-4);
  color: var(--grey-1);
}

/* ── Input ── */
.input {
  width: 100%;
  padding: 12px;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.54;
  letter-spacing: -0.2px;
  color: var(--text-color);
  background: var(--surface-4);
  border: 1px solid transparent;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.15s;
}

.input::placeholder {
  color: var(--grey-2);
}

.input:focus {
  border-color: var(--primary);
}

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

/* ── Category Badge (Icon) ── */
.category-badge {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.category-badge svg,
.category-badge img {
  width: 22px;
  height: 22px;
}

.category-badge.restaurant { background-color: rgba(255, 193, 7, 0.12); color: var(--cat-restaurant); }
.category-badge.cafe { background-color: rgba(151, 71, 255, 0.12); color: var(--cat-cafe); }
.category-badge.sightseeing { background-color: rgba(43, 186, 112, 0.12); color: var(--cat-sightseeing); }
.category-badge.accommodation { background-color: rgba(214, 43, 43, 0.12); color: var(--cat-accommodation); }
.category-badge.shopping { background-color: rgba(229, 53, 115, 0.12); color: var(--cat-shopping); }
.category-badge.nature { background-color: rgba(43, 186, 112, 0.12); color: var(--cat-nature); }
.category-badge.culture { background-color: rgba(43, 186, 112, 0.12); color: var(--cat-culture); }
.category-badge.entertainment { background-color: rgba(229, 53, 115, 0.12); color: var(--cat-entertainment); }
.category-badge.other { background-color: rgba(26, 26, 26, 0.08); color: var(--cat-other); }

/* ── Spacing Utilities ── */
.gap-4 { height: 4px; }
.gap-8 { height: 8px; }
.gap-12 { height: 12px; }
.gap-16 { height: 16px; }
.gap-24 { height: 24px; }

/* ── Text Utilities ── */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

/* ── App Banner ── */
.app-banner {
  margin-top: 24px;
  padding: 20px;
  text-align: center;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
}

.app-banner p {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.54;
  color: var(--grey-1);
  margin-bottom: 12px;
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 16px 12px 32px;
  max-width: 480px;
  margin: 0 auto;
}

.footer p {
  font-size: 11px;
  font-weight: 400;
  color: var(--grey-3);
}
