/* Lovetree Design System V3 - Base & Common Components */

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

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

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  font-family: 'Outfit', 'Noto Sans KR', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background-color: #fdfaf4;
  color: #0f172a;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* --- Global Brand Watermark: Soft Tree (Diverse Positioning) --- */
body::before {
  content: "";
  position: fixed;
  width: 450px;
  height: 600px;
  background: url('/assets/image/bg-tree-soft.png') no-repeat;
  background-size: contain;
  opacity: 0.12; /* Increased visibility */
  pointer-events: none;
  z-index: -1; /* Place behind all content */
  transition: all 0.5s ease;
}

/* Specific Positions per Page */
body[data-page="home"]::before { top: 0; right: -150px; transform: rotate(-15deg); }
body[data-page="community"]::before { top: 100px; left: -100px; }
body[data-page="my-trees"]::before { bottom: 0; right: -100px; transform: rotate(15deg); }
body[data-page="lovetree"]::before { top: 300px; left: -150px; transform: rotate(-10deg); }
body:not([data-page])::before,
body[data-page="settings"]::before { bottom: -100px; left: -100px; }
body[data-page="owner"]::before { top: 200px; right: -120px; transform: rotate(12deg); }
body[data-page="memory-detail"]::before { top: 50px; left: -80px; transform: rotate(-5deg); }
body[data-page="login"]::before { top: 100px; right: -100px; transform: rotate(8deg); }
/* ----------------------------------------------------------------- */

/* Typography Reset */
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; margin: 0; }
a { color: inherit; text-decoration: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* Global Shell - Standardized Width */
.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* Visibility Helpers */
.is-hidden { display: none !important; }

/* Navigation V2 - Ivory Glassmorphism */
.gnb-v2 {
  background: rgba(253, 250, 244, 0.85); /* Ivory tint to match body */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.4);
  position: fixed; /* Always fixed to top */
  top: 0;
  left: 0;
  z-index: 2000;
  width: 100%;
  height: 68px; /* Standardize height */
  display: flex;
  align-items: center;
}

/* Page Wrapper - Offset for fixed GNB */
.page-wrapper {
  padding-top: 68px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Minimal GNB Overrides */
.gnb-v2.gnb-minimal .gnb-links {
  gap: 12px;
}
.gnb-v2.gnb-minimal .gnb-links a:not(.gnb-exit-btn) {
  display: none;
}

.gnb-exit-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.gnb-exit-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.gnb-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.gnb-logo {
  font-size: 1.6rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.gnb-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.gnb-links a {
  text-decoration: none;
  font-weight: 700;
  color: #475569;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.gnb-links a:hover,
.gnb-links a.active {
  color: #e11d48;
}

/* Auth pending state - hide auth buttons until Firebase confirms */
#nav-auth-container.auth-pending #nav-login-btn,
#nav-auth-container.auth-pending #nav-user-group {
  display: none !important;
}

.btn-pill-auth {
  background: #0f172a;
  color: #fff !important;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}

/* Unified Feature Cards - Seamless Ivory Blend */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  padding: 80px 0;
}

.feat-card {
  background: rgba(255, 255, 255, 0.6); /* Semi-transparent to blend with ivory background */
  padding: 48px 32px;
  border-radius: 32px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.feat-card:hover {
  transform: translateY(-12px);
  background: #fff;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.08);
}

.feat-icon {
  font-size: 3rem;
  margin-bottom: 24px;
  display: inline-block;
}

.feat-card h3 {
  font-size: 1.4rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 16px;
}

.feat-card p {
  font-size: 1.05rem;
  color: #64748b;
  line-height: 1.7;
}

/* Loading Effects */
@keyframes loading-slide {
  0% { transform: translateX(-110%); }
  50% { transform: translateX(80%); }
  100% { transform: translateX(260%); }
}

.loading-bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1001;
  height: 3px;
  background: rgba(244, 63, 94, 0.1);
  overflow: hidden;
}

.loading-bar-fill {
  width: 40%;
  height: 100%;
  background: #f43f5e;
  animation: loading-slide 1.2s infinite;
}
/* User Menu & Dropdown (Unified V3) */
.gnb-user-group {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #f1f5f9;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-btn:hover {
  transform: scale(1.05);
  border-color: #e11d48;
}

.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gnb-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 220px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  z-index: 1100;
}

.gnb-dropdown.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.gnb-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 4px;
}

.dropdown-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.dropdown-header-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dropdown-name {
  font-weight: 800;
  font-size: 0.85rem;
  color: #0f172a;
}

.dropdown-email {
  font-size: 0.7rem;
  color: #94a3b8;
}

.dropdown-item {
  width: 100%;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #475569;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-item:hover {
  background: #fff1f2;
  color: #e11d48;
}

.dropdown-item-logout {
  color: #94a3b8;
  border-top: 1px solid #f1f5f9;
  margin-top: 4px;
  padding-top: 12px;
}

/* Mobile Bottom Navigation (v10) */
.gnb-mobile-bottom {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: rgba(253, 250, 244, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(226, 232, 240, 0.5);
  z-index: 1000;
}

.mob-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
}

.mob-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: #94a3b8;
  transition: all 0.2s ease;
}

.mob-nav-item.active {
  color: #e11d48;
}

.mob-nav-item .nav-icon {
  font-size: 1.4rem;
}

.mob-nav-item .nav-label {
  font-size: 0.75rem;
  font-weight: 800;
}

/* Show only on small screens */
@media (max-width: 768px) {
  .gnb-mobile-bottom {
    display: block;
  }
}
