/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --blue-primary: #007db8;
  --green-primary: #2aa85f;
  --red-accent: #e74c3c;
  --background: #ffffff;
  --foreground: #1a1a1a;
  --card: #f8f8f8;
  --border: #e0e0e0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  color: var(--foreground);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animations */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-fade-in {
  animation: fade-in 0.5s ease-out forwards;
}

.animate-fade-in-up {
  animation: fade-in-up 0.6s ease-out forwards;
}

.animate-slide-down {
  animation: slide-down 0.3s ease-out forwards;
}

.animate-slide-in-right {
  animation: slide-in-right 0.5s ease-out forwards;
}

.animation-delay-100 {
  animation-delay: 100ms;
}

.animation-delay-200 {
  animation-delay: 200ms;
}

.animation-delay-300 {
  animation-delay: 300ms;
}

.animation-delay-400 {
  animation-delay: 400ms;
}

.animation-delay-500 {
  animation-delay: 500ms;
}

/* Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header Styles */
header {
  background-color: white;
  border-bottom: 1px solid #e5e7eb;
  position: relative;
}

.header-content {
  display: flex;
  align-items: center;
  height: 48px;
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 1;
  text-decoration: none;
  max-width: 200px;
}

.logo img {
  height: 45px;
  width: auto;
}

.desktop-nav {
  display: none;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.nav-item {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-link {
  color: #000;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 14px 16px 14px;
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: #1e5799;
}


.mobile-menu-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: none;
  border: none;
  margin-left: auto;
  cursor: pointer;
  border-radius: 0.5rem;
}

.mobile-menu-button:hover {
  background-color: #f3f4f6;
}

.mobile-menu-button svg {
  width: 24px;
  height: 24px;
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 50;
  max-height: 80vh;
  overflow-y: auto;
}

.mobile-menu.active {
  display: block;
}

.mobile-menu-item {
  border-bottom: 1px solid #f3f4f6;
}

.mobile-menu-item:last-child {
  border-bottom: none;
}

.mobile-menu-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  color: #374151;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.mobile-menu-header:hover {
  background-color: #f9fafb;
}

.mobile-menu-header span {
  font-weight: 500;
}

.mobile-submenu {
  display: none;
  background-color: #f9fafb;
  padding: 0.5rem 0;
}

.mobile-submenu.active {
  display: block;
}

.mobile-submenu a {
  display: block;
  padding: 0.5rem 2rem;
  font-size: 0.875rem;
  color: #4b5563;
  text-decoration: none;
}

.mobile-submenu a:hover {
  color: #1e5799;
  background-color: #f3f4f6;
}

/* ===========================================
   반응형 메가메뉴
   - 모바일: 완전 숨김 (아코디언 submenu 사용)
   - PC: hover 시 표시
   =========================================== */

/* 기본(모바일): 메가메뉴 숨김 */
.mega-menu {
  display: none;
}

/* 메가메뉴 컨텐츠 레이아웃 */
.mega-menu-content {
  display: flex;
  min-height: 180px;
}

/* 왼쪽 영역: 제목 + 배너 */
.mega-menu-left {
  width: 250px;
  flex-shrink: 0;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  position: relative;
  overflow: hidden;
}

.mega-menu-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #000;
  padding: 1.5rem 1.5rem 1rem;
}

.mega-menu-banner {
  flex: 1;
  display: flex;
  align-items: flex-end;
  padding: 0;
  position: relative;
}

.mega-menu-banner-content {
  position: relative;
  z-index: 2;
}

.mega-menu-banner .banner-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #4a9cc7;
  border-radius: 50%;
  color: white;
  margin-bottom: 0.5rem;
}

.mega-menu-banner .banner-text-small {
  font-size: 0.9375rem;
  color: #000;
  margin: 0;
}

.mega-menu-banner .banner-text-large {
  font-size: 1.1875rem;
  font-weight: bold;
  color: #000;
  margin: 0.25rem 0 0;
}

.mega-menu-banner-image {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* 오른쪽 영역: 5개 카테고리 열 */
.mega-menu-right {
  flex: 1;
  display: flex;
}

.mega-menu-column {
  flex: 1;
  padding: 0 0.75rem 0.75rem;
  border-right: 1px solid #f3f4f6;
  border-top: 3px solid transparent;
}

.mega-menu-column:last-child {
  border-right: none;
}

.mega-menu-column h3 {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  padding: 1rem 0 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: center;
  color: #000;
}

.mega-menu-column h3 a {
  color: inherit;
  text-decoration: none;
}

.mega-menu-column h3 a:hover {
  background-color: #1e5799;
  color: #fff;
}

/* 활성 카테고리 스타일 - 상단 파란 보더 */
.mega-menu-column.active {
  border-top: 3px solid #1e5799;
}

.mega-menu-column.active h3 {
  color: #1e5799;
}

.mega-menu-column.active h3 a {
  color: #1e5799;
}

.mega-menu-column ul {
  list-style: none;
  padding: 0;
  padding-top: 0.5rem;
  margin: 0;
}

.mega-menu-column li {
  margin-bottom: 0.375rem;
}

.mega-menu-column li a {
  display: block;
  font-size: 0.875rem;
  color: #000;
  text-decoration: none;
  padding: 0.25rem 0;
  text-align: center;
  transition: color 0.2s;
}

.mega-menu-column li a:hover {
  background-color: #1e5799;
  color: #fff;
}

/* ===========================================
   PC 전용 메가메뉴 동작 (768px 이상)
   =========================================== */
@media (min-width: 768px) {
  /* 메가메뉴 기본 스타일 (PC) */
  .mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow: hidden;
  }

  /* 메가메뉴 컨테이너 - 전체 너비 사용 */
  .mega-menu > .container {
    max-width: none;
    padding: 0;
  }

  /* 메가메뉴 왼쪽 영역 - 뷰포트 왼쪽 끝부터 시작 */
  .mega-menu-left {
    flex: none;
    width: calc((100vw - min(100vw, 1400px)) / 2 + 1rem + 220px);
    padding-left: calc((100vw - min(100vw, 1400px)) / 2 + 1rem);
  }

  /* 메가메뉴 오른쪽 영역 - 헤더 컨테이너 오른쪽 끝에 맞춤 */
  .mega-menu-right {
    padding-right: calc((100vw - min(100vw, 1400px)) / 2 + 1rem);
  }

  /* 타이틀, 배너를 메가메뉴 왼쪽 끝부터 시작 */
  .mega-menu-title {
    margin-left: calc(-1 * ((100vw - min(100vw, 1400px)) / 2 + 1rem));
    padding-left: calc((100vw - min(100vw, 1400px)) / 2 + 1.5rem);
  }

  .mega-menu-banner {
    margin-left: calc(-1 * ((100vw - min(100vw, 1400px)) / 2 + 1rem));
    width: calc(100% + (100vw - min(100vw, 1400px)) / 2 + 1rem);
  }

  /* 메가메뉴 활성화 (JS로 제어) */
  .mega-menu.active {
    display: block;
    animation: slideDown 0.2s ease-out;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* PC에서 개별 드롭다운 서브메뉴 숨김 (메가메뉴 사용) */
  .main-nav .nav-item:hover .submenu {
    display: none;
  }
}

/* ===========================================
   대형 화면 메가메뉴 조정
   =========================================== */
@media (min-width: 1024px) {
  .mega-menu-left {
    width: calc((100vw - min(100vw, 1400px)) / 2 + 1rem + 280px);
    padding-left: calc((100vw - min(100vw, 1400px)) / 2 + 1rem);
  }

  .mega-menu-column {
    padding: 0 1rem 1rem;
  }

  .mega-menu-column h3 {
    font-size: 1.0625rem;
  }

  .mega-menu-column li a {
    font-size: 0.9375rem;
  }
}

@media (min-width: 1200px) {
  .mega-menu-left {
    width: calc((100vw - min(100vw, 1400px)) / 2 + 1rem + 320px);
    padding-left: calc((100vw - min(100vw, 1400px)) / 2 + 1rem);
  }
}

/* Main Section */
.main-section {
  background-color: #f3f4f6;
  padding: 1rem 0.5rem;
}

.main-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.main-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.main-right {
  width: 100%;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* BIS/ITS Cards */
.bis-its-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: none;
}

.bis-card,
.its-card {
  flex: 1;
  border-radius: 0.5rem;
  overflow: hidden;
  height: 200px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}

.bis-card:hover,
.its-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: scale(1.02);
}

.bis-card img,
.its-card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-content {
  position: relative;
  padding: 1.5rem;
  color: white;
  z-index: 10;
}

/* 실시간버스정보, 도로소통현황 글씨 좀더 크게 변경 */
.card-content p {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.card-content h2 {
  font-size: 3rem;
  font-weight: bold;
}

/* Small Cards Grid */
.small-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-left: -0.75rem;
  margin-right: -0.75rem;
  margin-bottom: 0;
}

.small-card {
  border-radius: 0.5rem;
  height: 160px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.small-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.small-card-content {
  position: relative;
  z-index: 10;
  padding: 0.75rem;
  text-align: center;
}

.small-card h3 {
  font-weight: bold;
  font-size: 0.875rem;
  margin-top: 1.5rem;
  margin-bottom: 0.25rem;
}

/* Search Panel */
.search-header {
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.search-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.search-icon {
  width: 40px;
  height: 40px;
  background-color: #f3f4f6;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-title {
  font-size: 1.125rem;
  font-weight: bold;
  color: #1f2937;
}

.search-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.search-tab {
  padding: 0.375rem 0.75rem;
  border: 2px solid #4a9cc7;
  color: #4a9cc7;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.search-tab:hover,
.search-tab.active {
  background-color: #4a9cc7;
  color: white;
}

.search-input-wrapper {
  display: flex;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  overflow: hidden;
  transition: border-color 0.2s;
}

.search-input-wrapper:focus-within {
  border-color: #4a9cc7;
}

.search-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: none;
  outline: none;
  min-width: 0;
}

.search-button {
  padding: 0 1rem;
  background: white;
  border: none;
  border-left: 1px solid #d1d5db;
  color: #4a9cc7;
  cursor: pointer;
  transition: all 0.2s;
}

.search-button:hover {
  background-color: #4a9cc7;
  color: white;
}

/* Search Select (유형 탭) */
.search-select-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.search-select {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  outline: none;
  background-color: white;
  cursor: pointer;
}

.search-select:focus {
  border-color: #4a9cc7;
}

.search-select-wrapper .search-button {
  padding: 0.4rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.search-select-wrapper .search-button svg {
  width: 16px;
  height: 16px;
}

/* Search Help */
.search-help {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.search-help-badge {
  display: inline-block;
  background-color: #4a9cc7;
  color: white;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.6875rem;
  margin-right: 0.25rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.search-help-badge:hover {
  background-color: #3a8cb7;
}

.search-help-text {
  color: #6b7280;
}

.search-help-desc {
  margin-top: 0.375rem;
  line-height: 1.4;
  color: #4b5563;
}

/* Notice Section */
.notice-section {
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title h4 {
  font-weight: bold;
  color: #4a9cc7;
  font-size: 1rem;
}

.expand-button {
  width: 24px;
  height: 24px;
  border: 1px solid #d1d5db;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.expand-button:hover {
  background-color: #f3f4f6;
}

.notice-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.notice-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  padding: 0.25rem;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.notice-item:hover {
  background-color: #f9fafb;
}

.notice-item span:first-child {
  color: #374151;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-item span:last-child {
  color: #9ca3af;
  margin-left: 0.5rem;
  white-space: nowrap;
}

/* Traffic Info Section */
.traffic-section {
  padding: 1rem;
}

.traffic-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.traffic-item {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  padding: 0.25rem;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-bottom: 0.5rem;
}

.traffic-item:hover {
  background-color: #f9fafb;
}

.traffic-from {
  color: #374151;
  width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.traffic-arrow {
  margin: 0 0.5rem;
  flex-shrink: 0;
}

.traffic-to {
  color: #374151;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.traffic-status {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  flex-shrink: 0;
  color: white;
}

.status-congestion {
  background-color: #ef4444;
}

.status-delay {
  background-color: #f97316;
}

/* Footer */
footer {
  margin-top: auto;
}

.footer-top {
  background-color: #00205d;
}

.footer-top-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: auto;
  padding: 0.5rem 0;
  gap: 0.5rem;
}

.footer-title {
  color: white;
  font-weight: bold;
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #d1d5db;
}

.footer-links a {
  color: #d1d5db;
  text-decoration: none;
}

.footer-links a:hover {
  color: white;
}

.footer-divider {
  color: #9ca3af;
}

.footer-bottom {
  background-color: #f5f5f5;
  border-top: 1px solid #d1d5db;
}

.footer-bottom-content {
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.footer-info {
  font-size: 0.875rem;
  color: #4b5563;
}

.footer-info p {
  margin-bottom: 0.125rem;
  word-break: break-word;
}

.footer-copyright {
  color: #6b7280;
  font-size: 0.625rem;
}

.footer-related {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.footer-related span {
  color: #4b5563;
  font-size: 0.875rem;
  white-space: nowrap;
}

.footer-select-wrapper {
  display: flex;
  align-items: center;
  flex: 1;
}

.footer-select {
  flex: 1;
  background-color: white;
  color: #374151;
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
  padding-right: 2rem;
  border: 1px solid #d1d5db;
  border-radius: 0;
  appearance: none;
  min-width: 180px;
}

.footer-button {
  background-color: #00205d;
  color: white;
  padding: 0.375rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.footer-button:hover {
  background-color: #001a4d;
}

/* Responsive Design */
@media (min-width: 640px) {
  .main-section {
    padding: 1rem;
  }

  .bis-its-grid {
    flex-direction: row;
  }

  .bis-card,
  .its-card {
    height: 420px;
  }

  .card-content h2 {
    font-size: 4rem;
  }

  .small-card {
    height: 220px;
  }

  .small-card h3 {
    font-size: 1rem;
    margin-top: 2.5rem;
    margin-bottom: 0.5rem;
  }

  .footer-top-content {
    flex-direction: row;
    align-items: center;
    height: 40px;
    padding: 0;
    gap: 1.5rem;
  }

  .footer-copyright {
    font-size: 0.875rem;
  }

  .notice-item span:last-child {
    display: inline;
  }
}

@media (min-width: 768px) {
  .header-content {
    height: 50px;
  }

  .logo {
    width: 180px;
    flex-shrink: 0;
    max-width: none;
  }

  .logo img {
    height: 45px;
  }

  .desktop-nav {
    display: flex;
    flex: 1;
  }

  .mobile-menu-button {
    display: none;
  }
}

@media (min-width: 768px) {
  .main-grid {
    flex-direction: row;
    align-items: stretch;
  }

  .main-left {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .main-right {
    width: 380px;
  }

  .small-cards-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-left: 0;
    margin-right: 0;
  }

  .footer-bottom-content {
    flex-direction: row;
    align-items: center;
  }

  .footer-related {
    width: auto;
  }
}

@media (min-width: 1200px) {
  .logo {
    width: 350px;
  }
}

/* Mobile Sub-menu (Accordion) - Hidden on desktop */
.mobile-sub-menu {
  display: block;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .mobile-sub-menu {
    display: none;
  }
}

.mobile-sub-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem;
  background: linear-gradient(to right, #1a5c9e, #2980b9);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
}

.mobile-sub-menu-header svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s;
}

.mobile-sub-menu-header.active svg {
  transform: rotate(180deg);
}

.mobile-sub-menu-content {
  display: none;
  background: white;
  border: 1px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
}

.mobile-sub-menu-content.active {
  display: block;
}

.mobile-sub-menu-content a {
  display: block;
  padding: 0.75rem 1rem;
  color: #4b5563;
  text-decoration: none;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.9375rem;
}

.mobile-sub-menu-content a:last-child {
  border-bottom: none;
}

.mobile-sub-menu-content a:hover {
  background-color: #f9fafb;
}

.mobile-sub-menu-content a.active {
  color: #1a5c9e;
  font-weight: bold;
  background-color: #eff6ff;
}

/* Sub-page Layout - Mobile First */
.sub-page-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sub-page-sidebar {
  display: none;
}

.sub-page-main {
  flex: 1;
  min-width: 0;
}

/* Sub-page tables - Mobile: no horizontal scroll */
.sub-page-main div[style*="overflow-x"] {
  overflow-x: visible !important;
}

.sub-page-main table {
  font-size: 0.75rem;
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed;
}

.sub-page-main th,
.sub-page-main td {
  padding: 0.25rem;
  word-break: break-all;
  font-size: 0.7rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .sub-page-layout {
    flex-direction: row;
    gap: 2rem;
  }

  .sub-page-sidebar {
    display: block;
    width: 208px;
    flex-shrink: 0;
  }

  .sub-page-main div[style*="overflow-x"] {
    overflow-x: auto !important;
  }

  .sub-page-main table {
    font-size: 1rem;
    table-layout: auto;
    min-width: auto !important;
  }

  .sub-page-main th,
  .sub-page-main td {
    padding: 0.75rem;
    word-break: keep-all;
    font-size: 1rem;
    overflow: visible;
    text-overflow: clip;
  }
}

/* ===========================================
   통합 반응형 네비게이션 (헤더)
   =========================================== */

/* ===========================================
   모바일 전용 스타일 (767px 이하)
   =========================================== */
@media (max-width: 767px) {
  /* 모바일 메뉴 헤더 숨김 (기존 헤더 사용) */
  .mobile-nav-header {
    display: none !important;
  }

  /* 메인 네비게이션 (헤더 아래 드롭다운) */
  .main-nav {
    display: none !important;
  }

  .main-nav.active {
    display: block !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: #fff !important;
    z-index: 9999 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    border-top: 1px solid #e0e0e0;
  }

  .main-nav .nav-menu {
    display: block !important;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .main-nav .nav-item {
    display: block !important;
    border-bottom: 1px solid #e0e0e0;
  }

  .main-nav .nav-item:last-child {
    border-bottom: none;
  }

  .main-nav .nav-item-header {
    display: flex !important;
    align-items: center;
  }

  .main-nav .nav-link {
    flex: 1;
    display: block;
    padding: 14px 16px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    text-align: left !important;
  }

  .submenu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
  }

  .submenu-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
  }

  .submenu-toggle.active svg {
    transform: rotate(180deg);
  }

  .main-nav .submenu {
    display: none !important;
    list-style: none;
    margin: 0;
    padding: 0 0 8px 0;
    position: static !important;
    transform: none !important;
    background: #fff !important;
    border: none !important;
    box-shadow: none !important;
  }

  .main-nav .submenu.active {
    display: block !important;
  }

  .main-nav .submenu li a {
    display: block;
    padding: 10px 16px 10px 32px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    text-align: left !important;
  }
}

/* ===========================================
   데스크톱 전용 스타일 (768px 이상)
   =========================================== */
@media (min-width: 768px) {
  /* 모바일 메뉴 헤더 숨김 */
  .mobile-nav-header {
    display: none !important;
  }

  .main-nav {
    display: flex;
    flex: 1;
    position: static;
    background: none;
    border: none;
    box-shadow: none;
    max-height: none;
    overflow: visible;
    margin-top: 5px;
  }

  .main-nav.active {
    position: static;
    top: auto;
    bottom: auto;
  }

  .main-nav .nav-menu {
    display: flex;
    flex-direction: row;
    flex: 1;
  }

  .main-nav .nav-item {
    flex: 1;
    display: flex;
    justify-content: center;
    border-bottom: none;
    position: relative;
  }

  .main-nav .nav-item-header {
    justify-content: center;
  }

  .main-nav .nav-link {
    padding: 28px 16px;
    text-align: center;
    white-space: nowrap;
    font-size: 1.0625rem;
  }

  .main-nav .nav-link:hover {
    background: none;
  }

  /* 서브메뉴 토글 숨김 (데스크톱) */
  .submenu-toggle {
    display: none !important;
  }

  /* 서브메뉴 (데스크톱: 드롭다운) */
  .main-nav .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 180px;
    background: white;
    border: 1px solid #e5e7eb;
    border-top: 3px solid #1e5799;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 100;
  }

  /* 메가메뉴 사용으로 개별 드롭다운 비활성화 */
  /* .main-nav .nav-item:hover .submenu { display: block; } */

  .main-nav .submenu li a {
    padding: 0.75rem 1rem;
    text-align: center;
  }
  
  .search-header {
    padding: 0.75rem;
  }

  .search-title-wrapper {
    margin-bottom: 0.75rem;
  }

  .notice-section {
    padding: 0.75rem;
  }

  .traffic-section {
    padding: 0.75rem;
  }

  #congestion-content,
  #incident-content {
    height: 160px !important;
  }
}

/* 로고 너비 - 대형 화면 (메가메뉴 왼쪽과 동기화) */
@media (min-width: 1024px) {
  .logo {
    width: 280px;
  }
}

@media (min-width: 1200px) {
  .logo {
    width: 320px;
  }
}

/* ===========================================
   통합 반응형 사이드바
   =========================================== */

.unified-sidebar {
  margin-bottom: 1rem;
}

/* 모바일: 아코디언 스타일 */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.875rem 1rem;
  background: linear-gradient(to right, #1a5c9e, #2980b9);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
}

.sidebar-header svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s;
}

.sidebar-header.active svg {
  transform: rotate(180deg);
}

.sidebar-content {
  display: none;
  background: white;
  border: 1px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
}

.sidebar-content.active {
  display: block;
}

.sidebar-content a {
  display: block;
  padding: 0.75rem 1rem;
  color: #4b5563;
  text-decoration: none;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.9375rem;
}

.sidebar-content a:last-child {
  border-bottom: none;
}

.sidebar-content a:hover {
  background-color: #f9fafb;
}

.sidebar-content a.active {
  color: #1a5c9e;
  font-weight: bold;
  background-color: #eff6ff;
}

/* 데스크톱: 세로 사이드바 */
@media (min-width: 768px) {
  .unified-sidebar {
    width: 208px;
    flex-shrink: 0;
    margin-bottom: 0;
  }

  .sidebar-header {
    border-radius: 0.5rem 0.5rem 0 0;
    cursor: default;
  }

  .sidebar-header svg {
    display: none;
  }

  .sidebar-content {
    display: block;
    border-radius: 0;
    border: none;
    border-left: 4px solid #d1d5db;
    margin-left: 1.25rem;
    padding: 1rem 0;
    background: transparent;
  }

  .sidebar-content a {
    padding: 0.75rem 1.5rem;
    border-bottom: none;
    font-size: 15px;
  }

  .sidebar-content a:hover {
    background: transparent;
    color: #1a5c9e;
  }

  .sidebar-content a.active {
    border-left: 4px solid #1a5c9e;
    margin-left: -4px;
    background: transparent;
  }
}

/* ===========================================
   통합 반응형 서브페이지 레이아웃
   =========================================== */

.sub-page-layout-unified {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .sub-page-layout-unified {
    flex-direction: row;
    gap: 2rem;
  }
}

/* Utility Classes */
.hidden {
  display: none;
}

.visible {
  display: block;
}

/* ===========================================
   교통정보 공통 스타일
   =========================================== */
.vms-layout {
  display: flex;
  gap: 1rem;
}
.vms-map-container {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}
.vms-map-tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
}
.vms-map-tab {
  padding: 0.5rem 1rem;
  background-color: #f5f5f5;
  border: none;
  border-right: 1px solid #ddd;
  cursor: pointer;
  font-size: 0.8125rem;
  color: #666;
}
.vms-map-tab.active {
  background-color: #4a9cc7;
  color: white;
}
.vms-map-tab:hover:not(.active) {
  background-color: #e8e8e8;
}
.vms-list-container {
  width: 220px;
  flex-shrink: 0;
}
.vms-list-header {
  background-color: #4a9cc7;
  color: white;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 4px 4px 0 0;
}
.vms-list {
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 464px;
  overflow-y: auto;
}
.vms-list-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: #333;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.2s;
}
.vms-list-item:last-child {
  border-bottom: none;
}
.vms-list-item:hover {
  background-color: #f5f5f5;
}
.vms-list-item.active {
  background-color: #e3f2fd;
  color: #1976d2;
}
.vms-arrow {
  color: #4a9cc7;
  margin: 0 0.25rem;
}
@media (max-width: 768px) {
  .vms-layout {
    flex-direction: column;
  }
  .vms-list-container {
    width: 100%;
  }
}

/* Stop Info Popup */
.stop-info {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  width: 280px;
  z-index: 100;
  overflow: hidden;
}

.stop-info-header {
  background: #4fc3f7;
  color: #fff;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  cursor: move;
  user-select: none;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.stop-info-header svg {
  width: 20px;
  height: 20px;
}

.stop-info-body {
  padding: 12px;
}

.stop-info-row {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  padding: 4px 0;
}

.stop-info-row:last-child {
  border-bottom: none;
}

.stop-info-label {
  width: 80px;
  font-size: 14px;
  color: #6b7280;
  flex-shrink: 0;
}

.stop-info-value {
  font-size: 14px;
  font-weight: bold;
  color: #6b7280;
  flex: 1;
}

.stop-info-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
}

.stop-info-table thead {
  background: #4fc3f7;
}

.stop-info-table th {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 4px;
  text-align: center;
}

.stop-info-table td {
  font-size: 14px;
  padding: 10px 6px;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
}

.stop-info-table tr:last-child td {
  border-bottom: none;
}

.stop-info-table .route-num {
  color: #2196f3;
  font-weight: 600;
}

.stop-info-table .arrival-time {
  color: #111827;
}

.stop-info-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

/* 상단 고정 */
.stop-info-meta {
  padding: 6px 6px 0 6px;
}

.stop-info-table-wrapper {
  max-height: 250px; /* 테이블 최대 높이 */
  overflow-y: auto;  /* 세로 스크롤 활성화 */
}

/* 테이블 헤더 고정 설정 */
.stop-info-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #4fc3f7;
}

/* 스크롤바 디자인 */
.stop-info-table-wrapper::-webkit-scrollbar {
  width: 5px;
}
.stop-info-table-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}


/* VMS Info Popup */
.vms-info {
  position: absolute;
  top: 15%;
  right: 10%;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  width: 280px;
  z-index: 100;
  overflow: hidden;
}

.vms-info-header {
  background: #333;
  color: #fff;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: move;
  user-select: none;
}

.vms-info-body {
  padding: 12px;
  background: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: center;
}

.vms-info-body img {
  max-width: 100%;
  height: auto;
}

.vms-message {
  background: #fffde7;
  border: 2px solid #fdd835;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.vms-message-icon {
  width: 50px;
  height: 50px;
  margin-bottom: 8px;
}

.vms-message-text {
  font-size: 18px;
  font-weight: bold;
  color: #d32f2f;
  line-height: 1.4;
}

.vms-message-text .highlight {
  color: #1565c0;
}

.vms-info-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

/* 팝업 루트 컨테이너 */
#POPUP_OUTBREAK {
    position: absolute;
    z-index: 2000;
    display: none;
    pointer-events: auto;
}

.incident-info {
    min-width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: hidden;
    border: 1px solid #ef4444; /* 돌발은 빨간색 테두리로 강조 */
}

.incident-info-header {
    background-color: #ef4444;
    color: white;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
}

.incident-info-close {
    position: absolute;
    top: 6px;
    right: 12px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.incident-info-body {
    padding: 15px;
}

.incident-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

/* 상황별 배경색 */
.type-accident { background-color: #dc2626; }     /* 진한 빨강 */
.type-construction { background-color: #d97706; } /* 오렌지 */
.type-event { background-color: #2563eb; }        /* 파랑 */
.type-default { background-color: #4b5563; }      /* 회색 */

.incident-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
    line-height: 1.5;
    word-break: keep-all;
}

.incident-detail {
    font-size: 12px;
    border-top: 1px dashed #e5e7eb;
    padding-top: 10px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.detail-label {
    color: #6b7280;
    flex-shrink: 0;
}

.detail-value {
    color: #374151;
    font-weight: 500;
    text-align: right;
    padding-left: 10px;
}

.parking-tabs {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0;
}
.parking-tab {
  padding: 0.5rem 1.25rem;
  background-color: #e8e8e8;
  border: 1px solid #ccc;
  border-bottom: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  color: #333;
  transition: all 0.2s;
  margin-right: -1px;
}
.parking-tab.active {
  background-color: #4a9cc7;
  color: white;
  border-color: #4a9cc7;
}
.parking-tab:hover:not(.active) {
  background-color: #ddd;
}
.parking-content {
  display: none;
}
.parking-content.active {
  display: block;
}
.parking-layout {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.parking-map-container {
  flex: 1;
  border: 1px solid #ddd;
}
.parking-map-header {
  background-color: #4a9cc7;
  color: white;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
}
.parking-map {
  background-color: #f9f9f9;
  max-height: 400px;
}
.parking-map img {
  width: 100%;
  height: auto;
  display: block;
}
.parking-status-container {
  width: 220px;
  flex-shrink: 0;
}
.parking-address {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #ddd;
}
.status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.status-table th {
  background-color: #4a9cc7;
  color: white;
  padding: 0.5rem 0.5rem;
  text-align: center;
  border: 1px solid #3d8ab3;
  font-weight: 500;
  font-size: 0.8125rem;
}
.status-table td {
  padding: 0.4rem 0.5rem;
  text-align: center;
  border: 1px solid #e0e0e0;
  background-color: white;
  font-size: 0.8125rem;
}
.status-table tbody tr:first-child td {
  background-color: #e3f2fd;
  font-weight: 500;
}
.status-table tbody tr:first-child td:first-child {
  color: #1976d2;
}
.status-table .available {
  color: #1976d2;
  font-weight: 600;
}
.status-table .total {
  color: #333;
}
.parking-legend {
  display: flex;
  margin-top: 0.75rem;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
}
.legend-item {
  flex: 1;
  text-align: center;
  padding: 0.35rem 0.15rem;
  font-size: 0.625rem;
  color: #333;
  font-weight: 500;
  white-space: nowrap;
}
.legend-disabled { background-color: #91d1f3; }
.legend-pregnant { background-color: #f59fbc; }
.legend-compact { background-color: #a3d399; }
.legend-general { background-color: #adabac; }
.legend-available { background-color: #fefefe; border: 1px solid #ccc; }
.fee-section {
  margin-top: 1.5rem;
  border-top: 1px solid #ddd;
  padding-top: 1rem;
}
.fee-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.fee-header .icon {
  width: 20px;
  height: 20px;
  background-color: #4a9cc7;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fee-header .icon svg {
  width: 14px;
  height: 14px;
  color: white;
}
.fee-header h3 {
  font-size: 0.9375rem;
  color: #333;
  font-weight: 600;
  margin: 0;
}
.fee-table-wrapper {
  overflow-x: auto;
}
.fee-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.fee-table th {
  background-color: #f5f5f5;
  padding: 0.5rem 0.75rem;
  text-align: center;
  border: 1px solid #ddd;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
}
.fee-table td {
  padding: 0.5rem 0.75rem;
  text-align: center;
  border: 1px solid #ddd;
  background-color: white;
}
.fee-note {
  font-size: 0.6875rem;
  color: #999;
  margin-top: 0.25rem;
  text-align: right;
}
@media (max-width: 768px) {
  .parking-layout {
    flex-direction: column;
  }
  .parking-status-container {
    width: 100%;
  }
  .parking-tabs {
    flex-wrap: wrap;
  }
  .parking-tab {
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
  }
  .status-table {
    table-layout: fixed;
    width: 100% !important;
    font-size: 0.65rem !important;
  }
  .status-table th,
  .status-table td {
    padding: 0.25rem 0.15rem !important;
    font-size: 0.65rem !important;
    word-break: keep-all !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  .fee-table-wrapper {
    overflow-x: visible !important;
  }
  .fee-table {
    table-layout: fixed;
    width: 100% !important;
    font-size: 0.6rem !important;
  }
  .fee-table th,
  .fee-table td {
    padding: 0.25rem 0.1rem !important;
    font-size: 0.6rem !important;
    word-break: keep-all !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
}

/* 회전 애니메이션 정의 */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 애니메이션을 적용할 클래스 */
.refresh-spin {
    animation: spin 0.8s linear;
}

.no-select {
  /* 텍스트 선택 방지 */
  user-select: none;
  -webkit-user-select: none; /* 사파리 지원 */
  
  /* 마우스 커서를 기본 화살표로 고정 */
  cursor: default;
}

/* 모바일 및 태블릿 환경(1023px 이하)에서 아이폰 자동 확대 방지 */
@media (max-width: 1023px) {
  .search-input-wrapper input,
  #searchKeyword {
    font-size: 16px !important;
  }
}