/* ==========================================================================
   VIBE GUESTBOOK — MODERN LIGHT MODE DESIGN
   ========================================================================== */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  
  --text-main: #0f172a;
  --text-body: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --border-color: #e2e8f0;
  --border-focus: #c7d2fe;

  --accent-primary: #4f46e5;
  --accent-primary-hover: #4338ca;
  --accent-pink: #ec4899;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;

  --gradient-brand: linear-gradient(135deg, #4f46e5 0%, #a855f7 50%, #ec4899 100%);
  --gradient-card: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.03);

  --font-sans: 'Pretendard', 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-primary);
  color: var(--text-main);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

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

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

/* Background Grids & Ambient Glow */
.bg-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    linear-gradient(to right, rgba(226, 232, 240, 0.45) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(226, 232, 240, 0.45) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 15%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 15%, black 30%, transparent 80%);
  pointer-events: none;
  z-index: -2;
}

.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.55;
}

.glow-pink {
  top: -100px;
  left: 20%;
  width: 500px;
  height: 450px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.12) 0%, transparent 70%);
}

.glow-indigo {
  top: 25%;
  right: -50px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.12) 0%, transparent 70%);
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

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

/* Spring Bounce Keyframe Animation */
@keyframes cardSpring {
  0% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-12px) scale(1.02, 0.985); }
  52% { transform: translateY(-4px) scale(0.992, 1.012); }
  72% { transform: translateY(-9px) scale(1.008, 0.996); }
  88% { transform: translateY(-6px) scale(0.998, 1.002); }
  100% { transform: translateY(-7px) scale(1.005, 1.005); }
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--gradient-brand);
  color: #fff;
  font-size: 0.9rem;
}

.brand-sub {
  color: var(--accent-primary);
  font-weight: 700;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-item {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-body);
  transition: color 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
  color: var(--accent-primary);
}

.btn-write-anchor {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--text-main);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-write-anchor:hover {
  background: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 60px 0 48px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.hero-title {
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.04em;
  color: var(--text-main);
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 1.08rem;
  color: var(--text-body);
  max-width: 620px;
  margin: 0 auto 36px;
  line-height: 1.65;
}

/* Stats Bar */
.stats-bar {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 12px 32px;
  box-shadow: var(--shadow-md);
  gap: 28px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-primary);
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.live-tag {
  color: var(--accent-emerald) !important;
  font-size: 0.85rem;
  background: #ecfdf5;
  padding: 2px 8px;
  border-radius: 4px;
}

.stat-divider {
  width: 1px;
  height: 18px;
  background: var(--border-color);
}

/* ==========================================================================
   Content Layout (Form & Feed)
   ========================================================================== */
.content-section {
  padding: 40px 0 100px;
}

.main-layout {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 36px;
  align-items: start;
}

/* Form Card */
.form-wrapper {
  position: sticky;
  top: 96px;
}

.form-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
}

.form-header {
  margin-bottom: 24px;
}

.form-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.form-header p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.guestbook-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.label-with-count {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.char-counter {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Name & Avatar Picker */
.name-input-group {
  display: flex;
  gap: 10px;
  position: relative;
}

.avatar-dropdown-wrap {
  position: relative;
}

.avatar-select-btn {
  width: 46px;
  height: 46px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  transition: all 0.2s ease;
}

.avatar-select-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

.avatar-picker-popup {
  display: none;
  position: absolute;
  top: 54px;
  left: 0;
  width: 170px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: var(--shadow-xl);
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  z-index: 50;
}

.avatar-picker-popup.open {
  display: grid;
}

.avatar-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-body);
  transition: background 0.15s ease;
}

.avatar-opt:hover {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
}

.form-input {
  flex: 1;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.92rem;
  background: #fafbfc;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Tag Selector */
.tag-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-opt {
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
  transition: all 0.2s ease;
}

.tag-opt:hover {
  background: #ffffff;
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.tag-opt.active {
  background: #eff6ff;
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 700;
}

.form-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.6;
  background: #fafbfc;
  color: var(--text-main);
  resize: vertical;
  min-height: 105px;
  transition: all 0.2s ease;
}

.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  background: var(--accent-primary);
  color: #ffffff;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
  transition: all 0.2s ease;
}

.btn-submit:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

/* ==========================================================================
   Guestbook Feed
   ========================================================================== */
.list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.feed-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feed-title-wrap h2 {
  font-size: 1.4rem;
  font-weight: 800;
}

.feed-count-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.filter-group {
  display: flex;
  gap: 6px;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  color: var(--text-main);
  background: var(--bg-tertiary);
}

.filter-btn.active {
  background: #ffffff;
  border-color: var(--border-color);
  color: var(--text-main);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* Messages Grid & Card Design */
.messages-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.msg-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  will-change: transform;
}

.msg-card:hover {
  animation: cardSpring 0.65s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  box-shadow: var(--shadow-lg);
  border-color: var(--border-focus);
}

.msg-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.msg-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.author-details {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.msg-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-light);
}

.msg-tag {
  font-size: 0.75rem;
  font-weight: 700;
  background: #f1f5f9;
  color: var(--text-body);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.msg-body {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.btn-like {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.btn-like:hover {
  background: #fdf2f8;
  color: var(--accent-pink);
  border-color: #fbcfe8;
  transform: scale(1.05);
}

.btn-like.liked {
  background: #fdf2f8;
  color: var(--accent-pink);
  border-color: #f472b6;
  font-weight: 700;
}

.btn-delete {
  font-size: 0.75rem;
  color: var(--text-light);
  transition: color 0.15s ease;
}

.btn-delete:hover {
  color: #ef4444;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}

.empty-state h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

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

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 36px 0;
  background: #ffffff;
}

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

.footer-left strong {
  font-size: 0.95rem;
}

.footer-left p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-right {
  display: flex;
  gap: 20px;
}

.nav-footer-link {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.nav-footer-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .form-wrapper {
    position: static;
  }
  .stats-bar {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: var(--radius-lg);
    gap: 16px;
  }
  .stat-divider {
    display: none;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 18px;
  }
}

@media (max-width: 640px) {
  .nav-menu {
    display: none;
  }
  .feed-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .filter-group {
    width: 100%;
    overflow-x: auto;
  }
}
