/* ==========================================================
   global.css — BEELESSON public site
   Shared base, theme, header, section, footer styles
   ========================================================== */

/* Reset-ish */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
  background-color: var(--bg);
  color: var(--ink);
}

/* Theme variables */
body.theme-light {
  --bg: #f9fafb;
  --bg-alt: #ffffff;
  --bg-soft: #f3f4f6;
  --ink: #0f172a;
  --ink-soft: #6b7280;
  --border: #e5e7eb;
  --accent: #fbbf24; /* warm "bee" yellow */
  --accent-soft: #fef3c7;
  --header-bg: rgba(255, 255, 255, 0.9);
  --header-border: #e5e7eb;
  --hero-overlay: rgba(15, 23, 42, 0.3);
  --card-bg: #ffffff;
  --card-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --footer-bg: #0f172a;
  --footer-ink: #e5e7eb;
  --footer-ink-soft: #9ca3af;
}

body.theme-dark {
  --bg: #020617;
  --bg-alt: #020617;
  --bg-soft: #0b1120;
  --ink: #e5e7eb;
  --ink-soft: #9ca3af;
  --border: #1f2933;
  --accent: #facc15;
  --accent-soft: #4b3a01;
  --header-bg: rgba(15, 23, 42, 0.9);
  --header-border: #1e293b;
  --hero-overlay: rgba(15, 23, 42, 0.6);
  --card-bg: #0b1120;
  --card-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --footer-bg: #020617;
  --footer-ink: #e5e7eb;
  --footer-ink-soft: #64748b;
}

/* Utilities */
.hidden {
  display: none !important;
}
.max-w-5xl {
  max-width: 64rem;
}
.max-w-6xl {
  max-width: 72rem;
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}
.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

/* ================= HEADER ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  backdrop-filter: blur(10px);
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.header-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}
.header-logo-img {
  height: 32px;
  width: auto;
}
.header-logo-text {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.header-nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .header-nav {
    display: flex;
  }
}
.nav-link {
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--ink-soft);
  position: relative;
  padding-bottom: 3px;
}
.nav-link:hover {
  color: var(--ink);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #f97316);
  transition: width 0.18s ease-out;
}
.nav-link.nav-active::after {
  width: 100%;
}
.nav-link.nav-active {
  color: var(--ink);
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ================= HEADER - MOBILE NAV ================= */

/* Hamburger button */
.header-mobile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background-color: var(--bg-soft);
  padding: 0;
  margin-left: 0.25rem;
  cursor: pointer;
}

.header-mobile-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.header-mobile-toggle-bar {
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background-color: var(--ink);
}

/* Rotate / X 상태용 (선택) */
.header-mobile-toggle.is-open .header-mobile-toggle-bar:nth-child(1) {
  transform: translateY(3px) rotate(45deg);
}
.header-mobile-toggle.is-open .header-mobile-toggle-bar:nth-child(2) {
  opacity: 0;
}
.header-mobile-toggle.is-open .header-mobile-toggle-bar:nth-child(3) {
  transform: translateY(-3px) rotate(-45deg);
}

/* Mobile menu panel */
.header-mobile-menu {
  position: fixed;
  top: 64px;               /* header height */
  left: 0;
  right: 0;
  z-index: 25;
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  backdrop-filter: blur(10px);
  padding: 0.75rem 1rem 1rem;
}

.header-mobile-menu-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* 모바일에서 nav-link를 세로로 사용 */
.header-mobile-menu .nav-link {
  display: block;
  padding: 0.4rem 0;
  font-size: 0.95rem;
}

/* Header visibility rules */
@media (min-width: 768px) {
  .header-mobile-toggle {
    display: none;
  }
  .header-mobile-menu {
    display: none !important;
  }
}

/* Buttons */
.btn-primary,
.btn-outline,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out,
    background-color 0.12s ease-out, border-color 0.12s ease-out;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #f97316);
  border-color: #ea580c;
  color: #111827;
  box-shadow: 0 8px 20px rgba(234, 88, 12, 0.45);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(234, 88, 12, 0.55);
}
.btn-outline {
  background-color: transparent;
  border-color: var(--border);
  color: var(--ink-soft);
}
.btn-outline:hover {
  background-color: var(--bg-soft);
  color: var(--ink);
}
.btn-ghost {
  background-color: transparent;
  border-color: transparent;
  color: var(--ink-soft);
}
.btn-ghost:hover {
  background-color: var(--bg-soft);
  color: var(--ink);
}
.header-auth-btn {
  max-width: 160px;
}

/* Theme toggle */
.theme-toggle {
  border-radius: 999px;
  border: 1px solid var(--border);
  background-color: var(--bg-soft);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
}
.theme-toggle:hover {
  background-color: var(--accent-soft);
}

/* ================= GENERIC SECTIONS ================= */
.section {
  padding: 3.5rem 0;
  background-color: var(--bg);
  color: var(--ink);
}
.section:nth-of-type(even) {
  background-color: var(--bg-soft);
}
.section-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.section-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
}
.section-subtitle {
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.section-empty {
  font-size: 0.9rem;
  color: var(--ink-soft);
  border-radius: 0.75rem;
  border: 1px dashed var(--border);
  padding: 0.9rem 0.9rem;
}

/* ================= FOOTER ================= */
.site-footer {
  background-color: var(--footer-bg);
  color: var(--footer-ink);
  padding: 2.5rem 0 1.8rem;
}
.site-footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}
.footer-top {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .footer-top {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}
.footer-main {
  flex: 1;
  min-width: 0;
}
.footer-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.footer-info {
  font-size: 0.85rem;
  color: var(--footer-ink-soft);
  margin-bottom: 0.7rem;
}
.footer-company-line {
  font-size: 0.8rem;
  color: var(--footer-ink-soft);
}
.footer-company-line + .footer-company-line {
  margin-top: 0.2rem;
}
.footer-cta-wrap {
  margin-top: 0.9rem;
}
.footer-cta {
  font-size: 0.9rem;
}

.footer-side {
  width: 100%;
  max-width: 260px;
}

/* ▼▼ FOOTER NAV NOW VERTICAL ▼▼ */
.footer-nav {
  display: flex;
  flex-direction: column;      /* vertical stack */
  gap: 0.35rem;                /* space between links */
  margin-bottom: 1rem;
}
.footer-link {
  font-size: 0.83rem;
  color: var(--footer-ink-soft);
  text-decoration: none;
}
.footer-link:hover {
  color: var(--footer-ink);
  text-decoration: underline;
}

.footer-social {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.footer-social-link {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background-color: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--footer-ink);
  font-size: 1rem;
  text-decoration: none;
}
.footer-social-link:hover {
  background-color: rgba(55, 65, 81, 0.9);
}

.footer-bottom {
  border-top: 1px solid rgba(55, 65, 81, 0.8);
  padding-top: 0.9rem;
  font-size: 0.75rem;
  color: var(--footer-ink-soft);
}
.footer-copy {
  display: block;
}


/* ================= AUTH MODAL ================= */

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(15, 23, 42, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  border-radius: 1rem;
  background-color: var(--card-bg);
  box-shadow: var(--card-shadow);
  padding: 1.6rem 1.5rem 1.5rem;
  color: var(--ink);
}

.auth-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 1rem;
}

.auth-modal-close:hover {
  color: var(--ink);
}

.auth-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
}

.auth-modal-subtitle {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0 0 1rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.auth-label {
  font-size: 0.85rem;
  font-weight: 500;
}

.auth-input {
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  padding: 0.45rem 0.65rem;
  font-size: 0.9rem;
  background-color: var(--bg-alt);
  color: var(--ink);
}

.auth-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.auth-field-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.auth-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.auth-checkbox input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

.auth-link {
  border: none;
  background: none;
  padding: 0;
  font-size: 0.82rem;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

.auth-link[disabled] {
  opacity: 0.4;
  cursor: default;
  text-decoration: none;
}

.auth-help {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 0;
}

.auth-error {
  min-height: 1rem;
  font-size: 0.8rem;
  color: #f97373;
  margin-top: 0.15rem;
}

.auth-submit-btn {
  width: 100%;
  margin-top: 0.3rem;
}

.auth-footer-text {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  display: flex;
  justify-content: center;
  gap: 0.3rem;
}

/* Terms */
.auth-terms-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.auth-terms-body {
  max-height: 200px;
  overflow-y: auto;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background-color: var(--bg-soft);
  padding: 0.6rem 0.7rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  white-space: pre-line;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 0.75rem;
}

/* ================= GLOBAL LOADING OVERLAY ================= */

.global-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background-color: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.global-overlay-content {
  min-width: 220px;
  max-width: 320px;
  padding: 1.4rem 1.25rem;
  border-radius: 0.9rem;
  background-color: var(--card-bg);
  box-shadow: var(--card-shadow);
  text-align: center;
  color: var(--ink);
}

.global-overlay-spinner {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 3px solid rgba(148, 163, 184, 0.4);
  border-top-color: var(--accent);
  margin: 0 auto 0.75rem;
  animation: global-overlay-spin 0.8s linear infinite;
}

.global-overlay-message {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

@keyframes global-overlay-spin {
  to {
    transform: rotate(360deg);
  }
}


/* ================= HEADER USER DROPDOWN ================= */

.header-user-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.header-user-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background-color: var(--bg-soft);
  color: var(--ink);
  font-size: 0.9rem;
  cursor: pointer;
}

.header-user-toggle:hover {
  background-color: var(--bg-alt);
}

.header-user-name {
  max-width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-user-caret {
  font-size: 0.7rem;
  color: var(--ink-soft);
}

.header-user-dropdown {
  position: absolute;
  right: 0;
  top: 110%;
  min-width: 150px;
  margin-top: 0.25rem;
  padding: 0.3rem;
  border-radius: 0.75rem;
  background-color: var(--card-bg);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  z-index: 40;
}

.header-user-item {
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 0.4rem 0.55rem;
  border-radius: 0.55rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
  cursor: pointer;
}

.header-user-item:hover {
  background-color: var(--bg-soft);
  color: var(--ink);
}


