/* ═══════════════════════════════════════════════════════
   회사 주변 점심 맛집 - Premium Light Theme
   ═══════════════════════════════════════════════════════ */

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

/* ─── CSS Variables ──────────────────────────────── */
:root {
  --bg-primary: #f5f7fb;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8faff;
  --bg-surface: rgba(255, 255, 255, 0.9);
  --bg-modal: rgba(15, 23, 42, 0.45);

  --accent-primary: #6366f1;
  --accent-secondary: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --accent-orange: #ea8c00;
  --accent-red: #ef4444;
  --accent-green: #059669;
  --accent-pink: #db2777;
  --accent-cyan: #0891b2;

  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --border-color: rgba(148, 163, 184, 0.22);
  --border-hover: rgba(99, 102, 241, 0.35);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 0 3px var(--accent-glow);
  --shadow-float: 0 20px 60px rgba(0, 0, 0, 0.15);
  --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.04);

  --transition-fast: 0.15s ease;
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Noto Sans KR', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Soft background accents */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 700px 500px at 5% 10%, rgba(99, 102, 241, 0.06), transparent),
    radial-gradient(ellipse 500px 500px at 90% 70%, rgba(236, 72, 153, 0.04), transparent),
    radial-gradient(ellipse 400px 400px at 50% 95%, rgba(6, 182, 212, 0.04), transparent);
  pointer-events: none;
  z-index: 0;
}

/* ─── Layout ─────────────────────────────────────── */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* ─── Header ─────────────────────────────────────── */
.app-header {
  text-align: center;
  margin-bottom: 32px;
  padding: 40px 20px 32px;
  position: relative;
}

.app-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
}

.app-title {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.app-title .icon {
  -webkit-text-fill-color: initial;
  margin-right: 8px;
}

.app-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 300;
}

/* ─── Stats Bar ──────────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  transition: var(--transition-base);
  box-shadow: var(--shadow-subtle);
}

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

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-secondary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── Toolbar ────────────────────────────────────── */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
}

.search-box {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition-base);
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
  background: var(--bg-secondary);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.filter-select {
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition-base);
  outline: none;
  min-width: 120px;
}

.filter-select:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.filter-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition-base);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #7c3aed);
  color: white;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
}

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

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.08);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.18);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-base);
  font-size: 1rem;
}

.btn-icon:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* ─── Spot Cards Grid ────────────────────────────── */
.spots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.spot-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
}

.spot-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-pink));
  opacity: 0;
  transition: var(--transition-base);
}

.spot-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.spot-card:hover::before {
  opacity: 1;
}

.spot-card.is-favorite {
  border-color: rgba(234, 140, 0, 0.25);
  background: linear-gradient(135deg, #fffbf0, #ffffff);
}

.spot-card.is-favorite::before {
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-pink));
  opacity: 1;
}

.spot-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}

.spot-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.spot-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.spot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.badge-category {
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent-secondary);
  border: 1px solid rgba(99, 102, 241, 0.12);
}

.badge-rating {
  background: rgba(234, 140, 0, 0.08);
  color: var(--accent-orange);
  border: 1px solid rgba(234, 140, 0, 0.12);
}

.badge-price {
  background: rgba(5, 150, 105, 0.08);
  color: var(--accent-green);
  border: 1px solid rgba(5, 150, 105, 0.12);
}

.badge-walk {
  background: rgba(8, 145, 178, 0.08);
  color: var(--accent-cyan);
  border: 1px solid rgba(8, 145, 178, 0.12);
}

.badge-visit {
  background: rgba(219, 39, 119, 0.08);
  color: var(--accent-pink);
  border: 1px solid rgba(219, 39, 119, 0.12);
}

.spot-address {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.map-link {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
  border-bottom: 1px dashed var(--border-color);
}

.map-link:hover {
  color: var(--accent-primary);
  border-bottom-style: solid;
  border-bottom-color: var(--accent-primary);
}


.spot-memo {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 10px 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--accent-primary);
}

.spot-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.spot-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.spot-footer-actions {
  display: flex;
  gap: 6px;
}

.btn-visit {
  padding: 5px 12px;
  font-size: 0.75rem;
  background: rgba(5, 150, 105, 0.08);
  color: var(--accent-green);
  border: 1px solid rgba(5, 150, 105, 0.12);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-base);
}

.btn-visit:hover {
  background: rgba(5, 150, 105, 0.15);
}

.btn-fav {
  padding: 5px 10px;
  font-size: 0.9rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-base);
  line-height: 1;
}

.btn-fav.active {
  background: rgba(234, 140, 0, 0.1);
  border-color: rgba(234, 140, 0, 0.25);
}

/* ─── Empty State ────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  grid-column: 1 / -1;
}

.empty-state .icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ─── Modal ──────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-modal);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: var(--transition-slow);
  box-shadow: var(--shadow-float);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

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

.modal-body {
  padding: 24px 28px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 28px 24px;
  border-top: 1px solid var(--border-color);
}

/* ─── Form ───────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition-base);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
  background: var(--bg-secondary);
}

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

.form-select option {
  background: var(--bg-secondary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Star Rating Input */
.star-rating-input {
  display: flex;
  gap: 4px;
  direction: rtl;
  justify-content: flex-end;
}

.star-rating-input input {
  display: none;
}

.star-rating-input label {
  cursor: pointer;
  font-size: 1.5rem;
  color: #d1d5db;
  transition: var(--transition-fast);
}

.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input:checked ~ label {
  color: var(--accent-orange);
}

/* ─── Toast ──────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.5s forwards;
}

.toast.success {
  border-left: 3px solid var(--accent-green);
}

.toast.error {
  border-left: 3px solid var(--accent-red);
}

.toast.info {
  border-left: 3px solid var(--accent-primary);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* ─── Loading ────────────────────────────────────── */
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 60px auto;
}

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

/* ─── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
  .app-container {
    padding: 16px 12px 60px;
  }

  .app-title {
    font-size: 1.5rem;
  }

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

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    min-width: 100%;
  }

  .spots-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .modal {
    max-width: 100%;
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 480px) {
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-value {
    font-size: 1.3rem;
  }

  .spot-card {
    padding: 16px;
  }
}

/* ─── Confirm Dialog ─────────────────────────────── */
.confirm-dialog {
  max-width: 380px;
}

.confirm-dialog .modal-body {
  text-align: center;
  padding: 32px 28px;
}

.confirm-dialog .confirm-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.confirm-dialog .confirm-msg {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.confirm-dialog .modal-footer {
  justify-content: center;
}

/* ─── Footer ─────────────────────────────────────── */
.app-footer {
  margin-top: 60px;
  text-align: center;
  padding: 40px 0 20px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}
