/* ===========================
   common.css
   집찾GO 공통 스타일
   - 서브페이지 공통 헤더
   - 서브페이지 공통 푸터
=========================== */

:root {
  --primary: #1E88FF;
  --accent: #17D4B3;
  --dark: #0F172A;
  --text: #172033;
  --gray: #64748B;
  --light: #F8FAFC;
  --white: #ffffff;

  --header-width: min(1500px, 92%);
  --gradient-main: linear-gradient(135deg, #1E88FF, #17D4B3);
}

/* ===========================
   Reset
=========================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(30, 136, 255, 0.16), transparent 35%),
    linear-gradient(135deg, #F8FAFC, #EEF7FF);
  overflow-x: hidden;
}

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

button {
  font-family: inherit;
}

img,
svg,
canvas {
  max-width: 100%;
}

input,
select,
textarea,
button {
  min-width: 0;
}

/* ===========================
   Premium Header
=========================== */

.main-header {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);

  width: var(--header-width);
  height: 78px;
  padding: 0 28px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-radius: 28px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);

  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow:
    0 22px 55px rgba(30, 136, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);

  z-index: 1000;
  transition: 0.35s ease;
  animation: headerDrop 0.75s ease forwards;
}

.main-header.scrolled {
  top: 10px;
  height: 68px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(30, 136, 255, 0.08);
}

@keyframes headerDrop {
  from {
    opacity: 0;
    transform: translate(-50%, -24px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Logo */

.main-header .logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.main-header .logo img {
  height: 90px;
  display: block;
  padding-top: 0;
  object-fit: contain;
  transition: 0.35s ease;
}

.main-header .logo:hover img {
  transform: scale(1.05) rotate(-1deg);
  filter: drop-shadow(0 8px 14px rgba(30, 136, 255, 0.22));
}

/* Navigation */

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav a {
  position: relative;

  padding: 11px 16px;
  border-radius: 999px;

  display: flex;
  align-items: center;
  gap: 6px;

  color: #344054;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;

  overflow: hidden;
  transition: 0.28s ease;
}

.top-nav a i {
  font-size: 19px;
}

.top-nav a::before {
  content: "";
  position: absolute;
  inset: 0;

  border-radius: 999px;
  background: var(--gradient-main);

  opacity: 0;
  transform: scale(0.75);
  transition: 0.28s ease;
  z-index: -1;
}

.top-nav a:hover {
  color: white;
  transform: translateY(-2px);
}

.top-nav a:hover::before {
  opacity: 1;
  transform: scale(1);
}

/* ===========================
   Hamburger Button
=========================== */

.menu-btn {
  display: none;

  width: 44px;
  height: 44px;

  border: 0;
  border-radius: 15px;
  background: rgba(30, 136, 255, 0.12);

  cursor: pointer;
  transition: 0.25s ease;
}

.menu-btn:hover {
  background: rgba(30, 136, 255, 0.18);
}

.menu-btn span {
  display: block;

  width: 21px;
  height: 2px;
  margin: 5px auto;

  border-radius: 999px;
  background: var(--primary);
  transition: 0.3s ease;
}

.menu-btn.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.menu-btn.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===========================
   Common Footer
=========================== */

.site-footer {
  width: min(1500px, 92%);
  margin: 34px auto 34px;
  padding: 28px 32px 20px;

  border-radius: 32px;
  background: linear-gradient(135deg, #0F172A, #172033);
  color: white;

  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;

  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer-brand a {
  display: flex;
  align-items: center;
}

.footer-brand img {
  height: 56px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(23, 212, 179, 0.22));
}

.footer-brand strong,
.footer-brand h2 {
  display: block;
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 6px;
  color: white;
}

.footer-brand p {
  color: #CBD5E1;
  font-size: 14px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-links a {
  padding: 10px 14px;
  border-radius: 999px;

  color: #CBD5E1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;

  background: rgba(255, 255, 255, 0.06);
  transition: 0.25s ease;
}

.footer-links a:hover {
  color: white;
  background: var(--gradient-main);
  transform: translateY(-2px);
}

.footer-info {
  padding-top: 18px;

  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;

  color: #94A3B8;
  font-size: 13px;
  line-height: 1.7;
}

.footer-info span {
  position: relative;
  padding: 0 10px;
}

.footer-info span:not(:last-child)::after {
  content: "|";
  position: absolute;
  right: -5px;
  color: rgba(255, 255, 255, 0.24);
}

/* ===========================
   Mobile
=========================== */

@media (max-width: 768px) {
  body {
    background:
      radial-gradient(circle at top right, rgba(23, 212, 179, 0.18), transparent 36%),
      linear-gradient(180deg, #F8FAFC 0%, #EEF7FF 100%);
  }

  .main-header {
    top: 12px;
    width: calc(100% - 28px);
    height: 66px;
    padding: 0 16px;
    border-radius: 22px;

    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.75);
  }

  .main-header.scrolled {
    top: 8px;
    height: 62px;
  }

  .main-header .logo img {
    height: 72px;
  }

  .menu-btn {
    display: block;
  }

  .top-nav {
    position: absolute;
    top: 78px;
    right: 0;

    width: min(230px, calc(100vw - 28px));
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    padding: 14px;

    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;

    border-radius: 24px;
    background: rgba(8, 17, 32, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    box-shadow: 0 22px 46px rgba(0, 0, 0, 0.25);

    opacity: 0;
    pointer-events: none;
    transform: translateY(-14px) scale(0.96);
    transition: 0.32s ease;
  }

  .top-nav.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .top-nav a {
    width: 100%;
    padding: 13px 16px;

    color: white;
    font-size: 15px;
    text-align: left;
    justify-content: flex-start;
  }

  .top-nav a::before {
    display: none;
  }

  .top-nav a:hover {
    background: rgba(255, 255, 255, 0.09);
    transform: translateY(0);
  }

  .site-footer {
    width: 92%;
    margin: 28px auto 24px;
    padding: 26px 22px 20px;
    border-radius: 26px;
  }

  .footer-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
  }

  .footer-brand {
    align-items: center;
  }

  .footer-brand img {
    height: 50px;
  }

  .footer-brand strong,
  .footer-brand h2 {
    font-size: 20px;
  }

  .footer-brand p {
    font-size: 13px;
  }

  .footer-links {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .footer-links a {
    min-width: 0;
    text-align: center;
    font-size: 13px;
    padding: 11px 8px;
    word-break: keep-all;
  }

  .footer-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    font-size: 12px;
  }

  .footer-info span {
    padding: 0;
  }

  .footer-info span::after {
    display: none;
  }
}
/* ===========================
   공통 로그인 메뉴 제어
=========================== */

.top-nav .user-menu {
  display: none !important;
}

.top-nav .guest-menu {
  display: flex !important;
}

body.login-active .top-nav .guest-menu {
  display: none !important;
}

body.login-active .top-nav .user-menu {
  display: flex !important;
}

.top-nav .logout-btn {
  color: white !important;
  background: var(--gradient-main);
  box-shadow: 0 10px 24px rgba(30, 136, 255, 0.22);
}

.top-nav .logout-btn i {
  color: white !important;
}

.top-nav .logout-btn:hover {
  color: white !important;
  background: var(--gradient-main);
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(30, 136, 255, 0.32);
}

body.nav-open {
  overflow: hidden;
}

/* Horizontal logo visibility on dark footers */
footer .footer-brand a {
  width: 175px;
  height: 59px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 17px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .16);
}

footer .footer-brand a img {
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: contain;
  filter: none;
  transform: scale(1.28);
}

@media (max-width: 768px) {
  footer .footer-brand a {
    width: 150px;
    height: 51px;
  }
}
