/* ================================
   메인 헤더 및 네비게이션
   헤더, 탭, 서브메뉴
================================ */

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-pokeball {
  width: 32px;
  height: 32px;
  background: linear-gradient(to bottom, var(--pokemon-red) 50%, white 50%);
  border-radius: 50%;
  border: 2px solid #333;
  position: relative;
}

.mini-pokeball::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: white;
  border: 2px solid #333;
  border-radius: 50%;
}

.app-title {
  color: var(--text-light);
  font-weight: 700;
  font-size: 18px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

#current-user-name {
  color: var(--gold-primary);
  font-weight: 600;
}

.btn-logout {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: inherit;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* 네비게이션 */
.main-nav {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.6);
}

/* 메인 탭 */
.nav-tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: var(--transition-normal);
  font-family: inherit;
  position: relative;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-tab.active {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
  color: #000000;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.4);
}

.nav-tab .nav-icon {
  font-size: 20px;
}

.nav-tab > span:not(.nav-badge):last-of-type {
  font-size: 11px;
  font-weight: 600;
}

/* 하위 메뉴 컨테이너 */
.nav-submenu-container {
  padding: 8px 16px;
}

.nav-submenu {
  display: none;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-submenu.active {
  display: flex;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: var(--transition-normal);
  font-family: inherit;
  position: relative;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.nav-btn.active {
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold-primary);
  border: 1px solid var(--gold-primary);
  box-shadow: 0 3px 12px rgba(212, 175, 55, 0.2);
}

.nav-icon {
  font-size: 22px;
}

.nav-btn > span:not(.nav-badge):last-of-type {
  font-size: 11px;
  font-weight: 500;
}

/* 알림 배지 */
.nav-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  background: #ff3b30;
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  animation: badgePop 0.3s ease;
}

.nav-badge.hidden {
  display: none;
}

@keyframes badgePop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* 메인 컨텐츠 */
.main-content {
  padding: 24px;
}

/* 미디어 쿼리 */
@media (max-width: 768px) {
  .main-header {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-left .app-title {
    font-size: 14px;
  }

  .header-right {
    gap: 8px;
  }

  #current-user-name {
    font-size: 13px;
  }

  .btn-logout {
    padding: 6px 12px;
    font-size: 12px;
  }

  .btn-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .nav-tabs {
    gap: 2px;
    padding: 8px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    flex-shrink: 0;
    padding: 8px 14px;
  }

  .nav-tab .nav-icon {
    font-size: 18px;
  }

  .nav-tab > span:not(.nav-badge):last-of-type {
    font-size: 10px;
  }

  .nav-submenu-container {
    padding: 6px 12px;
  }

  .nav-submenu {
    gap: 6px;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }

  .nav-submenu::-webkit-scrollbar {
    display: none;
  }

  .nav-btn {
    flex-shrink: 0;
    padding: 8px 14px;
  }

  .nav-icon {
    font-size: 20px;
  }

  .nav-btn > span:not(.nav-badge):last-of-type {
    font-size: 10px;
  }

  .nav-badge {
    min-width: 16px;
    height: 16px;
    font-size: 9px;
    top: 2px;
    right: 2px;
  }

  .main-content {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .main-header {
    padding: 10px 12px;
  }

  .header-left .app-title {
    display: none;
  }

  .mini-pokeball {
    width: 28px;
    height: 28px;
  }

  #current-user-name {
    font-size: 12px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .btn-logout {
    padding: 6px 10px;
    font-size: 11px;
  }

  .nav-tabs {
    padding: 6px 8px;
  }

  .nav-tab {
    padding: 6px 10px;
  }

  .nav-tab .nav-icon {
    font-size: 16px;
  }

  .nav-tab > span:not(.nav-badge):last-of-type {
    font-size: 9px;
  }

  .nav-submenu-container {
    padding: 4px 8px;
  }

  .nav-btn {
    padding: 6px 10px;
  }

  .nav-icon {
    font-size: 18px;
  }

  .nav-btn > span:not(.nav-badge):last-of-type {
    font-size: 8px;
  }

  .nav-badge {
    min-width: 14px;
    height: 14px;
    font-size: 8px;
    top: 2px;
    right: 2px;
  }
}

@media (max-width: 360px) {
  .nav-tab {
    padding: 5px 8px;
  }

  .nav-tab .nav-icon {
    font-size: 14px;
  }

  .nav-tab > span:not(.nav-badge):last-of-type {
    font-size: 8px;
  }

  .nav-btn {
    padding: 5px 8px;
  }

  .nav-icon {
    font-size: 16px;
  }

  .nav-btn > span:not(.nav-badge):last-of-type {
    font-size: 8px;
  }

  .nav-badge {
    min-width: 12px;
    height: 12px;
    font-size: 7px;
    top: 1px;
    right: 1px;
  }
}
