/* 헤더 스타일 */
.header {
  width: 100%;
  height: 80px;
  background: linear-gradient(90deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  overflow: hidden;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 헤더 배경 패턴 */
.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
  pointer-events: none;
}

/* 로고 영역 */
.header-logo {
  padding: 0 30px;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
}

.header-logo h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  letter-spacing: -0.5px;
}

/* 네비게이션 영역 */
.header-nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex: 1;
  padding: 0 20px;
}

.header-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.header-nav li {
  border-radius: 8px;
  overflow: hidden;
}

/* 네비게이션 링크 */
.header-nav a {
  display: block;
  padding: 12px 18px;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 14px;
  position: relative;
  border-radius: 8px;
  white-space: nowrap;
}

/* 호버 효과 */
.header-nav a:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  transform: translateY(-2px);
}

/* 활성 메뉴 */
.header-nav a.active {
  background: rgba(255,255,255,0.2);
  color: white;
  box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}

/* 활성 메뉴 하단 바 */
.header-nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 3px;
  background: linear-gradient(90deg, #fff 0%, rgba(255,255,255,0.8) 100%);
  border-radius: 3px 3px 0 0;
}

/* 헤더 액션 영역 (로그아웃 버튼) */
.header-actions {
  padding: 0 30px;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
}

/* 로그아웃 버튼 */
.logout-btn {
  padding: 10px 20px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(231,76,60,0.3);
}

.logout-btn:hover {
  background: #c0392b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(231,76,60,0.4);
}

/* 모바일 메뉴 토글 버튼 */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  padding: 10px;
  cursor: pointer;
  margin-right: 15px;
}

.mobile-menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: white;
  margin: 5px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* 모바일 메뉴 토글 애니메이션 */
.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

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

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

/* 반응형 - 태블릿 */
@media screen and (max-width: 1024px) {
  .header-nav a {
    padding: 10px 14px;
    font-size: 13px;
  }

  .header-logo h1 {
    font-size: 22px;
  }
}

/* 반응형 - 모바일 */
@media screen and (max-width: 768px) {
  .header {
    height: 60px;
    padding: 0 15px;
  }

  .header-logo h1 {
    font-size: 20px;
  }

  /* 모바일 메뉴 토글 표시 */
  .mobile-menu-toggle {
    display: block;
  }

  /* 네비게이션 숨김/표시 */
  .header-nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }

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

  .header-nav ul {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .header-nav li {
    width: 100%;
  }

  .header-nav a {
    width: 100%;
    text-align: center;
    padding: 15px;
  }

  .header-nav a.active::after {
    display: none;
  }

  .header-nav a.active {
    background: rgba(255,255,255,0.15);
  }

  /* 헤더 액션 조정 */
  .header-actions {
    padding: 0 15px;
  }

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

/* 반응형 - 초소형 모바일 */
@media screen and (max-width: 480px) {
  .header {
    height: 50px;
  }

  .header-logo h1 {
    font-size: 18px;
  }

  .header-nav {
    top: 50px;
    max-height: calc(100vh - 50px);
  }

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

/* 가로 모드 최적화 */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .header {
    height: 50px;
  }

  .header-logo h1 {
    font-size: 18px;
  }

  .header-nav a {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* 프린트 스타일 */
@media print {
  .header {
    display: none !important;
  }
}