/* 예약 페이지 공통 스타일 - KingKong Transport */

/* 기본 레이아웃 */
.booking-main {
  height: 100vh;
  background-color: #fff;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.booking-container {
  width: 100vw;
  height: 100vh;
  margin: 0;
  display: flex;
  padding: 0;
  position: relative;
}

/* 좌측 사이드바 */
.booking-sidebar {
  width: 380px;
  min-width: 380px;
  background: #fff;
  border-right: 1px solid #e9ecef;
  padding: 0;
  height: 100vh;
  overflow-y: auto;
  position: relative;
  flex-shrink: 0;
}

.booking-sidebar h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #333;
  padding: 0 24px;
}

/* 로고 영역 */
.sidebar-logo {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #e9ecef;
  background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
}

.allvan-logo {
  display: flex;
  align-items: baseline;
  font-family: "Arial", sans-serif;
  gap: 2px;
  cursor: pointer;
}

.logo-text {
  font-size: 24px;
  font-weight: 300;
  color: #333;
}

.logo-box {
  background: #333;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 24px;
  font-weight: 600;
}

.close-btn {
  display: none !important;
}

/* 서비스 탭 */
.service-tabs {
  margin: 16px 24px 24px 24px;
}

.service-tab {
  width: 100%;
  padding: 20px;
  border: 2px solid #e8f0fe;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.service-tab::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #007bff, #0056b3);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.service-tab:hover {
  border-color: #007bff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15);
}

.service-tab:hover::before {
  transform: translateX(0);
}

.service-tab.active {
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f3ff 100%);
  border-color: #007bff;
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.2);
}

.service-tab.active::before {
  transform: translateX(0);
}

.tab-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.service-tab .tab-icon {
  font-size: 28px;
  padding: 8px;
  background: linear-gradient(135deg, #007bff, #0056b3);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 123, 255, 0.3));
}

.tab-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tab-title {
  font-weight: 600;
  font-size: 16px;
  color: #1a1a1a;
  letter-spacing: -0.5px;
}

.tab-subtitle {
  font-size: 12px;
  color: #6c757d;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 경로 섹션 */
.route-section {
  padding: 24px;
  border-bottom: 1px solid #e9ecef;
}

.trip-type-buttons {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: #f8f9fa;
  border-radius: 6px;
  padding: 4px;
}

.trip-type-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  text-align: center;
}

.trip-type-btn:hover {
  background-color: #e9ecef;
}

.trip-type-btn.active {
  background: white;
  color: #007bff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.route-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.route-input-item {
  position: relative;
}

.route-input-container {
  position: relative;
  display: flex;
  align-items: center;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  background: white;
  transition: all 0.2s ease;
  padding: 0 12px;
  height: 48px;
}

.route-input-container:hover {
  border-color: #007bff;
}

.route-input-container:focus-within {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.route-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #28a745;
  margin-right: 12px;
  flex-shrink: 0;
}

.route-dot.green {
  background: #28a745;
}

.route-dot.black {
  background: #333;
}

.route-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: #333;
  background: transparent;
  padding: 0;
}

.route-input::placeholder {
  color: #999;
}

.clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: #f1f3f4;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  color: #666;
  transition: all 0.2s ease;
}

.clear-btn:hover {
  background: #e8eaed;
  color: #333;
}

/* 검색 드롭다운 */
.departure-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 4px;
  animation: fadeInUp 0.2s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-results {
  max-height: 200px;
  overflow-y: auto;
}

.search-results::-webkit-scrollbar {
  width: 6px;
}

.search-results::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.search-results::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

/* 일정 섹션 */
.schedule-section {
  padding: 24px;
  border-bottom: 1px solid #e9ecef;
}

.schedule-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 0 0 16px 0;
  padding: 0;
}

.schedule-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 8px;
}

.schedule-header .schedule-icon {
  color: #007bff;
}

.schedule-header span:last-child {
  font-size: 14px;
  color: #666;
}

.outbound-schedule {
  margin-bottom: 20px;
}

.schedule-inputs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.schedule-input-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-input-item label {
  font-size: 12px;
  font-weight: 500;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.schedule-datetime-input {
  padding: 10px 12px;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  font-size: 14px;
  color: #333;
  transition: border-color 0.2s ease;
}

.schedule-datetime-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* 승객 섹션 */
.passenger-section {
  padding: 24px;
  border-bottom: 1px solid #e9ecef;
}

.passenger-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 0 0 16px 0;
  padding: 0;
}

.passenger-section h4 {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 16px 0 12px 0;
}

.passenger-input-item {
  margin-bottom: 16px;
}

.passenger-input-item label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.counter-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background: white;
}

.counter-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  background: white;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.counter-btn:hover {
  border-color: #007bff;
  color: #007bff;
}

.counter-btn:active {
  background: #f8f9fa;
}

.counter-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f8f9fa;
}

.counter-input {
  width: 60px;
  text-align: center;
  border: none;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  background: transparent;
}

.input-note {
  font-size: 12px;
  color: #666;
  margin-top: 6px;
  font-style: italic;
}

.passenger-breakdown {
  font-size: 14px;
  color: #666;
  margin-left: auto;
}

.child-ages-section {
  margin-top: 16px;
  display: none;
}

.child-ages-section label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.child-ages-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.child-age-input-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
}

.child-age-label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin: 0;
}

.child-age-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
}

.child-age-select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.child-age-select:hover {
  border-color: #007bff;
}

.luggage-section {
  padding: 0;
  margin-top: 20px;
}

/* 예약 액션 */
.booking-action {
  padding: 24px;
  background: white;
  border-top: 1px solid #e9ecef;
}

.booking-submit-btn {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.booking-submit-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.6s ease;
}

.booking-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

.booking-submit-btn:hover::before {
  left: 100%;
}

.booking-submit-btn:active {
  transform: translateY(0);
}

.btn-icon {
  font-size: 18px;
  margin-right: 4px;
}

.btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.btn-subtitle {
  font-size: 12px;
  opacity: 0.9;
  font-weight: 400;
}

/* 지도 메인 */
.map-main {
  flex: 1;
  position: relative;
  height: 100vh;
  overflow: hidden; /* 원상복구 - 입력폼이 잘리지 않도록 */
}

.google-map {
  width: 100%;
  height: 100%;
  position: relative;
  background: #f0f0f0;
  overflow: hidden; /* 원상복구 */
}

.map-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 10;
  pointer-events: none;
}

/* 지도 컨트롤 버튼 */
.map-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: auto;
  z-index: 20;
}

.map-control-btn {
  width: 40px;
  height: 40px;
  background: white;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  user-select: none;
}

.map-control-btn:hover {
  background: #f5f5f5;
  border-color: rgba(0, 0, 0, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.map-control-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.map-control-btn span {
  pointer-events: none;
}

/* 예약 페이지 헤더 조정 */
.booking-page .header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: white;
  border-bottom: 1px solid #e9ecef;
}

.booking-page .header .container {
  max-width: none;
  padding: 0 20px;
}

.booking-page .header .header-top {
  display: none;
}

.booking-page .auth-buttons,
.booking-page .header .header-nav {
  display: none;
}

.booking-page .logo {
  margin: 0;
  padding: 12px 0;
}

.booking-page .booking-main {
  margin-top: 60px;
  height: calc(100vh - 60px);
}

@media (min-width: 1025px) {
  .booking-page .header {
    display: none;
  }

  .booking-page .booking-main {
    margin-top: 0;
    height: 100vh;
  }
}

body.booking-page {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

html {
  scroll-behavior: smooth;
  overflow: hidden;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
  .booking-container {
    flex-direction: column;
    height: calc(100vh - 60px);
  }

  .booking-sidebar {
    width: 100%;
    min-width: 100%;
    height: calc(100vh - 60px);
    overflow-y: auto;
  }

  .map-main {
    display: none;
  }

  .service-tabs {
    margin: 12px 16px 16px 16px;
  }

  .route-section,
  .schedule-section {
    padding: 16px;
  }

  .sidebar-logo {
    padding: 12px 16px;
  }

  .booking-page .header {
    display: none;
  }

  .booking-page .booking-main {
    margin-top: 0;
    height: 100vh;
  }
}

@media (max-width: 768px) {
  .booking-page .header {
    display: none;
  }

  .booking-page .booking-main {
    margin-top: 0;
  }

  .booking-container {
    height: 100vh;
  }

  .booking-sidebar {
    width: 100%;
    height: 100%;
    position: relative;
    overflow-y: auto;
    padding-bottom: 100px;
  }

  .sidebar-logo {
    padding: 8px 16px;
  }

  .route-section,
  .schedule-section {
    padding: 12px 16px;
  }

  .trip-type-buttons {
    gap: 2px;
    padding: 2px;
  }

  .trip-type-btn {
    padding: 6px 8px;
    font-size: 12px;
  }

  .service-tab {
    padding: 16px;
  }

  .service-tab .tab-icon {
    font-size: 24px;
  }

  .tab-title {
    font-size: 14px;
  }

  .tab-subtitle {
    font-size: 11px;
  }

  /* 모바일 지도 토글 기능 */
  .booking-container.map-visible {
    overflow: hidden !important;
  }

  .booking-container.map-visible .booking-sidebar {
    display: none !important;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-100%);
    transition: all 0.3s ease;
  }

  .booking-container.map-visible .map-main {
    display: block !important;
    width: 100% !important;
    height: 100vh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 999 !important;
    background: #fff;
  }

  .booking-container.map-visible .google-map {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
  }

  /* 지도 모드일 때 지도 오버레이 조정 */
  .booking-container.map-visible .map-overlay {
    background: transparent !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
  }

  /* 지도 모드일 때 컨트롤 버튼 위치 조정 */
  .booking-container.map-visible .map-controls {
    top: 20px !important;
    right: 20px !important;
    z-index: 1000 !important;
    pointer-events: auto !important;
  }

  /* 지도 모드일 때 floating 버튼이 지도 위에 오도록 */
  body.map-mode .mobile-map-toggle {
    z-index: 1001 !important;
  }
}

@media (max-width: 480px) {
  .service-tabs {
    margin: 8px 12px 12px 12px;
  }

  .service-tab {
    padding: 12px;
  }

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

  .tab-content {
    gap: 12px;
  }

  .tab-title {
    font-size: 13px;
  }

  .tab-subtitle {
    font-size: 10px;
  }

  .route-section,
  .schedule-section {
    padding: 12px;
  }

  .sidebar-logo {
    padding: 8px 12px;
  }

  .logo-text {
    font-size: 20px;
  }

  .logo-box {
    font-size: 20px;
    padding: 3px 6px;
  }

  .route-input-container {
    height: 44px;
    padding: 0 10px;
  }

  .route-input {
    font-size: 13px;
  }

  .schedule-datetime-input {
    padding: 8px 10px;
    font-size: 13px;
  }

  .counter-container {
    gap: 8px;
  }

  .counter-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .counter-input {
    font-size: 14px;
    padding: 6px 8px;
  }

  .booking-action {
    padding: 16px;
  }

  .booking-submit-btn {
    padding: 14px 20px;
    font-size: 15px;
  }

  .btn-text {
    align-items: center;
  }

  .btn-subtitle {
    font-size: 11px;
  }

  .passenger-section {
    padding: 16px;
  }

  .counter-container {
    padding: 10px 12px;
    justify-content: center;
  }

  /* 모바일에서 지도 컨트롤 버튼 조정 */
  .map-controls {
    top: 15px;
    right: 15px;
    gap: 4px;
  }

  .map-control-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}
