/* ============================================================
   common.css — Shared styles (header, nav, toggles, footer)
   Each page defines CSS variables:
     --accent          e.g. #6aedae | #4dffa6
     --accent-text     e.g. #0a0e17 | #111
     --toggle-bg       e.g. rgba(12,17,32,0.92) | rgba(17,17,17,0.92)
   ============================================================ */

/* ===== RESET ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', 'Noto Sans KR', sans-serif;
  color: #fff;
  position: relative;
}
body > * { position: relative; z-index: 1; }

/* ===== HEADER ===== */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 64px;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
header.scrolled {
  background: transparent;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.logo img { width: 120px; height: 30px; object-fit: contain; }

/* ===== NAV ===== */
nav { display: flex; gap: 40px; align-items: center; }
nav a {
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  letter-spacing: -0.1px;
}
nav a.active { color: var(--accent, #6aedae); }

/* ===== DROPDOWN ===== */
.nav-dropdown { position: relative; }
.nav-dropdown > a { cursor: default; }
.nav-dropdown > a::after {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  margin-left: 4px;
  vertical-align: middle;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
  transition: transform 0.2s ease;
}
.nav-dropdown:hover > a::after { transform: rotate(180deg); }

.nav-submenu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  min-width: 160px;
  background: #15171c;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 8px 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22), 0 1px 6px rgba(0,0,0,0.12);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}
.nav-submenu::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 0; right: 0;
  height: 14px;
}
.nav-dropdown:hover .nav-submenu {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-submenu a {
  display: block;
  padding: 9px 20px;
  font-size: 15px;
  color: rgba(255,255,255,0.7) !important;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-submenu a:hover {
  color: #fff !important;
  background: rgba(255,255,255,0.06);
}
.nav-submenu a.active { color: var(--accent, #6aedae) !important; }

/* ===== CTA BUTTON ===== */
.btn-primary {
  background: linear-gradient(90deg, var(--accent-mint, #22c55e), var(--accent-cyan, #22d3ee));
  color: #031019;
  border: none;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', 'Noto Sans KR', sans-serif;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(34,197,94,0.2), 0 6px 16px rgba(34,211,238,0.12);
  transform: translateY(-1px);
}
/* desktop: show header CTA, hide nav CTA */
.btn-primary--nav { display: none; }
.btn-primary--header { display: inline-block; }

/* ===== LANG TOGGLE ===== */
.lang-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--toggle-bg, rgba(12,17,32,0.92));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  font-family: 'Inter', sans-serif;
  transition: background 0.2s ease, border-color 0.2s ease;
  user-select: none;
}
.lang-toggle:hover {
  background: var(--toggle-bg-hover, rgba(12,17,32,1));
  border-color: rgba(255,255,255,0.2);
}
.lang-toggle .lang-indicator {
  display: inline-block;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: rgba(255,255,255,0.15);
  position: relative;
  transition: background 0.2s ease;
}
.lang-toggle .lang-indicator::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}
.lang-toggle.ko .lang-indicator {
  background: var(--accent, #6aedae);
}
.lang-toggle.ko .lang-indicator::after {
  transform: translateX(16px);
}

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 23px 0 28px;
  display: flex;
  justify-content: center;
}
.footer-inner {
  max-width: 1120px;
  width: 100%;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-copy {
  font-size: 12.5px;
  color: rgba(255,255,255,0.58);
}
.footer-links { display: flex; gap: 12px; }
.footer-links a {
  font-size: 12.5px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
}

/* ===== CONTACT MODAL ===== */
.contact-modal[hidden] { display: none; }
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.contact-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}
.contact-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100% - 32px));
  min-height: 420px;
  background: #ffffff;
  color: #222;
  border-radius: 12px;
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
}
.contact-modal__state[hidden] { display: none; }
.contact-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.contact-modal__title {
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
  color: #222;
}
.contact-modal__title.error { color: #d32f2f; }
.contact-modal__close {
  border: 0;
  background: transparent;
  color: #999;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.contact-modal__form {
  margin-top: 20px;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
}
.contact-modal__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.contact-modal__field label {
  font-size: 14px;
  line-height: 1.42;
  font-weight: 600;
  color: #222;
}
.contact-modal__field input {
  width: 100%;
  border: 0;
  border-radius: 5px;
  background: #f7f7f7;
  color: #222;
  font-size: 14px;
  line-height: 40px;
  padding: 0 12px;
  outline: none;
}
.contact-modal__field input::placeholder {
  color: #999;
}
.contact-modal__field input:disabled {
  opacity: 0.6;
}
.contact-modal__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 18px;
}
.contact-modal__actions.center { justify-content: center; }
.contact-modal__btn {
  border-radius: 5px;
  border: 1px solid #e5e5e5;
  background: #fff;
  color: #777;
  font-size: 14px;
  line-height: 1;
  font-weight: 400;
  padding: 12px 24px;
  cursor: pointer;
  font-family: 'Inter', 'Noto Sans KR', sans-serif;
}
.contact-modal__btn:hover {
  background: #f9f9f9;
}
.contact-modal__btn.primary {
  border-color: #0081a1;
  background: #0081a1;
  color: #fff;
}
.contact-modal__btn.primary:hover {
  background: #006d8a;
}
.contact-modal__btn.error {
  border-color: #d32f2f;
  background: #d32f2f;
  color: #fff;
}
.contact-modal__btn.error:hover {
  background: #b71c1c;
}
.contact-modal__btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.contact-modal__message {
  margin-top: 24px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 16px;
  line-height: 1.6;
  color: #555;
}

/* ===== HAMBURGER BUTTON ===== */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 110;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
/* animated X state */
.nav-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .hamburger span:nth-child(2) { opacity: 0; }
.nav-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
/* when nav is open, hamburger lines always white (overlay is dark) */
.nav-open .hamburger span { background: #fff; }

/* ===== MOBILE NAV OVERLAY ===== */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 98;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.nav-open .mobile-nav-overlay { opacity: 1; }

/* ===== RESPONSIVE — TABLET (≤ 1024px) ===== */
@media (max-width: 1024px) {
  header { padding: 20px 32px; }
  nav { gap: 24px; }
  nav a { font-size: 15px; }
  .nav-submenu a { font-size: 14px; }
  .logo img { width: 110px; height: 28px; }
  .footer-inner { padding: 0 32px; }
  .lang-toggle { bottom: 20px; right: 20px; }
}

/* ===== RESPONSIVE — MOBILE (≤ 768px) ===== */
@media (max-width: 768px) {
  header { padding: 16px 20px; }
  .logo img { width: 100px; height: 25px; }

  /* nav-open: disable backdrop-filter so position:fixed nav works correctly */
  header.nav-open {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: transparent !important;
  }

  /* show hamburger, hide header CTA, show nav CTA */
  .hamburger { display: flex; position: relative; z-index: 110; }
  .btn-primary--header { display: none !important; }
  .btn-primary--nav { display: inline-block; }

  /* mobile nav overlay */
  header nav {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99;
    background: #111;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 80px 40px;
    overflow-y: auto;
  }
  header.nav-open nav {
    display: flex;
  }
  header nav a {
    font-size: 20px;
    padding: 16px 0;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  header .btn-primary {
    margin-top: 24px;
    width: 100%;
    text-align: center;
    padding: 14px 18px;
    font-size: 16px;
  }

  /* dropdown in mobile: always visible, full width, no hover */
  .nav-dropdown { width: 100%; }
  .nav-dropdown > a::after { display: none; }
  .nav-dropdown:hover .nav-submenu {
    visibility: visible; opacity: 1; pointer-events: auto;
    transform: none;
  }
  .nav-submenu a:hover { background: none; }

  /* large menu labels (PRODUCT, NEWS) */
  .nav-dropdown > a {
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 1.5px !important;
    color: rgba(255,255,255,0.35) !important;
    text-align: center;
    padding: 24px 0 8px !important;
    border-bottom: none !important;
    pointer-events: none;
  }
  .nav-dropdown + .nav-dropdown {
    margin-top: 20px;
  }

  .nav-submenu {
    position: static;
    transform: none;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    min-width: auto;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }
  .nav-submenu a {
    font-size: 18px !important;
    font-weight: 400 !important;
    padding: 14px 0;
    text-align: center;
    color: rgba(255,255,255,0.85) !important;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .nav-submenu a.active {
    color: var(--accent, #6aedae) !important;
  }

  /* direct nav links (ABOUT, CAREERS) — same style as submenu items */
  header nav > a {
    font-size: 18px !important;
    font-weight: 400;
  }

  /* mobile nav overlay */
  .mobile-nav-overlay { display: block; }

  /* toggles */
  .lang-toggle { bottom: 16px; right: 16px; }

  /* footer */
  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 0 20px;
  }
  .footer-links { justify-content: center; }

  .contact-modal {
    padding: 12px;
  }
  .contact-modal__dialog {
    width: calc(100% - 24px);
    min-height: 390px;
    padding: 18px 14px 16px;
  }
  .contact-modal__title {
    font-size: 16px;
  }
  .contact-modal__actions {
    flex-wrap: wrap;
  }
  .contact-modal__btn {
    flex: 1 1 auto;
    min-width: 120px;
  }

  /* mobile: minimum button height */
  button, a[class*="btn"], .btn-primary, .btn-primary-lg, .btn-secondary, .btn-secondary-lg, .btnInline, .contact-btn, [type="button"], [type="submit"] {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
