/* ==========================================================
   HaLVision Top Navigation Styles
   ========================================================== */

:root {
  --topnav-height: 64px;
  --dark-color: #0a192f;
  --accent-color: #00e5ff;
}

/* ----------------------------------------------------------
   ナビバー本体
   ---------------------------------------------------------- */
.topnav {
  position: sticky;
  top: 0;
  width: 100%;
  height: var(--topnav-height);
  background: rgba(10, 25, 47, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 229, 255, 0.15);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

.topnav.scrolled {
  background: rgba(10, 25, 47, 0.98);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ----------------------------------------------------------
   ロゴ
   ---------------------------------------------------------- */
.topnav-logo a {
  font-family: 'Jost', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #00e5ff;
  letter-spacing: 0.05em;
  text-decoration: none;
}

/* ----------------------------------------------------------
   デスクトップナビメニュー
   ---------------------------------------------------------- */
.topnav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.topnav-item > a {
  display: block;
  padding: 0.5rem 0.875rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.topnav-item > a:hover,
.topnav-item.active > a {
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.08);
}

/* ----------------------------------------------------------
   ドロップダウン
   ---------------------------------------------------------- */
.has-dropdown {
  position: relative;
}

.topnav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  min-width: 200px;
  background: rgba(10, 25, 47, 0.98);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 10px;
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  list-style: none;
  margin: 0;
}

.has-dropdown:hover .topnav-dropdown,
.has-dropdown:focus-within .topnav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.topnav-dropdown li a {
  display: block;
  padding: 0.6rem 1rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.topnav-dropdown li a:hover {
  background: rgba(0, 229, 255, 0.1);
  color: #00e5ff;
  border-left-color: #00e5ff;
}

/* ----------------------------------------------------------
   LINEボタン（CTA）
   ---------------------------------------------------------- */
.topnav-line-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1.1rem;
  background: #06C755;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 20px;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
  margin-left: 0.5rem;
  white-space: nowrap;
}

.topnav-line-btn:hover {
  background: #05a847;
  transform: translateY(-1px);
}

/* ----------------------------------------------------------
   NEWバッジ
   ---------------------------------------------------------- */
.badge-new {
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  background: linear-gradient(135deg, #ff6b00, #dc2626);
  color: #fff;
  border-radius: 10px;
  vertical-align: middle;
  font-weight: 700;
}

/* ----------------------------------------------------------
   ハンバーガーボタン（モバイルのみ表示）
   ---------------------------------------------------------- */
.topnav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.topnav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #00e5ff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ハンバーガー → ✕ アニメーション */
.topnav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.topnav-hamburger.open span:nth-child(2) {
  opacity: 0;
}
.topnav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ----------------------------------------------------------
   モバイルドロワー
   ---------------------------------------------------------- */
.topnav-drawer {
  position: fixed;
  top: var(--topnav-height);
  left: 0;
  width: 100%;
  max-height: calc(100vh - var(--topnav-height));
  background: rgba(10, 25, 47, 0.98);
  overflow-y: auto;
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999;
}

.topnav-drawer.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.drawer-inner {
  padding: 1rem 0 2rem;
}

/* ドロワー各アイテム */
.drawer-item {
  border-bottom: 1px solid rgba(0, 229, 255, 0.08);
}

.drawer-link {
  display: block;
  padding: 1rem 1.5rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.drawer-link:hover {
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.05);
}

/* アコーディオンボタン */
.drawer-accordion-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.5rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s;
}

.drawer-accordion-btn:hover {
  color: #00e5ff;
}

.drawer-chevron {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
  color: rgba(0, 229, 255, 0.6);
}

.drawer-accordion-btn.open .drawer-chevron {
  transform: rotate(180deg);
}

/* アコーディオンコンテンツ */
.drawer-accordion-content {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: rgba(0, 0, 0, 0.2);
}

.drawer-accordion-content.open {
  max-height: 400px;
}

.drawer-accordion-content li a {
  display: block;
  padding: 0.75rem 1.5rem 0.75rem 2.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.drawer-accordion-content li a:hover {
  color: #00e5ff;
  border-left-color: #00e5ff;
}

/* ドロワーCTA */
.drawer-cta {
  padding: 1.5rem 1.5rem 0.5rem;
  display: flex;
  justify-content: center;
}

.drawer-cta .topnav-line-btn {
  margin-left: 0;
  padding: 0.7rem 2rem;
  font-size: 1rem;
}

/* ----------------------------------------------------------
   オーバーレイ
   ---------------------------------------------------------- */
.topnav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 998;
}

.topnav-overlay.active {
  display: block;
}

/* ----------------------------------------------------------
   レスポンシブ
   ---------------------------------------------------------- */
@media (max-width: 1024px) {
  .topnav-menu {
    display: none;
  }

  .topnav-hamburger {
    display: flex;
  }
}

@media (max-width: 480px) {
  .topnav {
    padding: 0 1rem;
  }

  .topnav-logo a {
    font-size: 1.25rem;
  }
}
