/* public/css/navbar.css - 添加響應式漢堡選單功能 */

/* Navbar 容器 - 直接對應 NavbarContainer */
.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  background-color: transparent;
  box-shadow: none;
}

/* 滾動時的樣式 - 對應 React 的 $scrolled 條件 */
.navbar-container.scrolled {
  background-color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Logo 區域 - 對應 LogoLink */
.logo-link {
  position: relative;
  width: 15rem;
  height: 3rem;
  flex-shrink: 0;
}

.logo-link a {
  display: block;
  width: 100%;
  height: 100%;
}

.logo-link img {
  margin-left: 2rem;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 導航右側 - 對應 NavbarRight */
.navbar-right {
  display: flex;
  align-items: center;
}

/* 導航選單 - 對應 NavbarList */
.navbar-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 導航項目 - 對應 NavItem */
.nav-item {
  margin: 0 1.5rem;
  text-align: center;
  padding: 0.7rem 1rem;
  min-width: 4.5rem;
  border-radius: 20px;
  transition: all 0.3s;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 活躍狀態 - 對應 React 的 $isActive */
.nav-item.active {
  background-color: #b8272e;
}

/* 懸停效果 */
.nav-item:hover {
  background-color: #f0f0f0;
}

.nav-item.active:hover {
  background-color: #ff0000;
}

/* 導航連結 - 對應 NavLink */
.nav-link {
  text-decoration: none;
  font-weight: 600;
  line-height: 1.2;
  color: #000000;
}

.nav-link.active {
  color: #f5f5f5;
}

/* 語言切換器 - 對應 SwitcherContainer */
.language-switcher {
  position: relative;
  display: inline-block;
}

/* 語言按鈕 - 對應 DropdownToggle */
.language-button {
  background: none;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  align-items: center;
  color: #b8272e;
  font-size: 0.8rem;
  display: flex;
  gap: 8px;
}

/* 國旗圖標 - 對應 Flag */
.flag-icon {
  width: 22px;
  height: auto;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 箭頭 - 對應 Arrow */
.arrow {
  margin-left: 8px;
  font-size: 10px;
}

/* 語言下拉選單 - 對應 DropdownMenu */
.language-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1001;
  min-width: 120px;
  padding: 5px 0;
  margin: 2px 0 0;
  background-color: rgba(255, 255, 255, 0.95);
  list-style: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.language-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 語言選項 - 對應 MenuItem */
.language-option {
  display: flex;
  align-items: center;
  padding: 8px 15px;
  color: #b8272e;
  text-decoration: none;
  font-size: 12px;
  gap: 8px;
}

.language-option:hover {
  background-color: #f5f5f5;
}

.language-option.active {
  font-weight: bold;
}

/* 漢堡選單按鈕 - 默認隱藏 */
.hamburger-menu {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #b8272e;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1002;
  transition: transform 0.3s ease;
}

.hamburger-menu:hover {
  transform: scale(1.1);
}

/* 手機版導航選單 */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background-color: white;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
  z-index: 1001;
  padding-top: 5rem;
  overflow-y: auto;
}

.mobile-nav.open {
  right: 0;
}

.mobile-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-nav-item {
  border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-link {
  display: block;
  padding: 1rem 2rem;
  text-decoration: none;
  color: #333;
  font-weight: 600;
  transition: background-color 0.3s;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background-color: #b8272e;
  color: white;
}

/* 手機版語言切換器 */
.mobile-language-switcher {
  padding: 1rem 2rem;
  border-top: 2px solid #f0f0f0;
  margin-top: 1rem;
}

.mobile-language-title {
  font-weight: 600;
  color: #b8272e;
  margin-bottom: 0.5rem;
}

.mobile-language-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-language-option {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  color: #333;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.3s;
  gap: 8px;
}

.mobile-language-option:hover {
  background-color: #f5f5f5;
}

.mobile-language-option.active {
  background-color: #b8272e;
  color: white;
}

/* 遮罩層 */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* 關閉按鈕 */
.mobile-nav-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #b8272e;
  cursor: pointer;
  padding: 0.5rem;
  transition: transform 0.3s ease;
}

.mobile-nav-close:hover {
  transform: scale(1.1);
}

/* 響應式斷點 */
@media (max-width: 1024px) {
  .navbar-container {
    padding: 1rem;
  }

  .logo-link {
    width: 12rem;
    height: 2.5rem;
  }

  .logo-link img {
    margin-left: 1rem;
  }

  .nav-item {
    margin: 0 1rem;
    padding: 0.5rem 0.8rem;
    min-width: 3.5rem;
  }
}

@media (max-width: 768px) {
  /* 隱藏桌面版選單，顯示漢堡按鈕 */
  .navbar-list {
    display: none;
  }

  .hamburger-menu {
    display: block;
  }

  .logo-link {
    width: 10rem;
    height: 2rem;
  }

  .logo-link img {
    margin-left: 0.5rem;
  }

  .navbar-container {
    padding: 0.8rem 1rem;
  }

  /* 桌面版語言切換器在手機上隱藏 */
  .language-switcher {
    display: none;
  }
}

@media (max-width: 480px) {
  .mobile-nav {
    width: 100%;
    right: -100%;
  }

  .logo-link {
    width: 8rem;
    height: 1.8rem;
  }

  .navbar-container {
    padding: 0.8rem;
  }
}
