/* ナビゲーション共通スタイル */
.navbar,
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.nav-container,
.top-bar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

/* ロゴ */
.nav-logo,
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #2d5a27;
  text-decoration: none;
}

.nav-logo i,
.logo i {
  font-size: 1.8rem;
  color: #7fb069;
}

/* ナビゲーションメニュー */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: #7fb069;
  background: rgba(127, 176, 105, 0.1);
}

.nav-link.active {
  color: #7fb069;
  background: rgba(127, 176, 105, 0.15);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: #7fb069;
  border-radius: 1px;
}

/* ユーザーセクション */
.nav-user,
.user-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-login {
  background: #7fb069;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-login:hover {
  background: #6a9c57;
  transform: translateY(-1px);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 8px;
  background: rgba(127, 176, 105, 0.1);
}

.user-profile.hidden {
  display: none;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-weight: 500;
  color: #333;
}

.btn-logout {
  background: #dc3545;
  color: white;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-logout:hover {
  background: #c82333;
}

/* モバイルメニュートグル */
.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
  gap: 4px;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: #333;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

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

  .nav-link {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    width: 100%;
    text-align: center;
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  .nav-user,
  .user-section {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }
}

/* ページ固有のナビゲーション調整 */
body {
  padding-top: 60px;
}

/* アニメーション */
@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.navbar,
.top-bar {
  animation: slideDown 0.3s ease;
}

/* ホバーエフェクト */
.nav-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(127, 176, 105, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 6px;
}

.nav-link:hover::before {
  opacity: 1;
}

/* アクセシビリティ */
.nav-link:focus {
  outline: 2px solid #7fb069;
  outline-offset: 2px;
}

.btn-login:focus,
.btn-logout:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
  .navbar,
  .top-bar {
    background: rgba(30, 30, 30, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  .nav-link {
    color: #e0e0e0;
  }

  .nav-link:hover {
    color: #7fb069;
    background: rgba(127, 176, 105, 0.2);
  }

  .user-name {
    color: #e0e0e0;
  }

  .nav-toggle span {
    background: #e0e0e0;
  }

  .nav-menu {
    background: #2a2a2a;
  }
}
