/**
 * VirtualScroll Component Styles
 * Styles for the virtual scroll location list component
 */

/* Virtual Scroll Container */
.virtual-scroll-container {
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: #ffffff;
  /* Improve scroll performance */
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  contain: layout style paint;
  /* Fix for confirm button overlap */
  margin-bottom: 20px;
  flex-shrink: 0;
}

/* Container for VirtualScroll - fix for layout issues */
.containerParentTextDiv {
  margin-bottom: 20px;
  max-height: 400px;
  /* overflow: hidden; */
  flex-shrink: 0;
}

/* Virtual Scroll Area */
.virtual-scroll-area {
  position: relative;
  width: 100%;
}

.virtual-scroll-viewport {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  will-change: transform;
}

/* Virtual Scroll Items */
.virtual-scroll-item {
  position: absolute;
  left: 0;
  right: 0;
  box-sizing: border-box;
  will-change: transform;
  contain: layout style paint;
  transform: translateZ(0); /* Force hardware acceleration */
  transition: height 0.3s ease;
  overflow: hidden;
}

.virtual-scroll-item.selected {
  background-color: #e3f2fd;
}

/* 展開內容的動畫 */
.virtual-scroll-item .contentAddress,
.virtual-scroll-item .operatingTime,
.virtual-scroll-item .contentLocationType {
  display: none;
  opacity: 0;
  max-height: 0;
  transition: opacity 0.3s ease, max-height 0.3s ease;
  overflow: hidden;
}

.virtual-scroll-item.selected .contentAddress,
.virtual-scroll-item.selected .operatingTime,
.virtual-scroll-item.selected .contentLocationType {
  display: block;
  opacity: 1;
  max-height: 200px; /* 足夠大的值 */
}

.virtual-scroll-item.selected .contentCity {
  display: none;
}

/* Location List Item Styles */
.containerChildTextDiv {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  /* border-bottom: 1px solid #f0f0f0; */
  cursor: pointer;
  transition: background-color 0.2s ease, border-left 0.2s ease;
  background-color: #ffffff;
  /* min-height: 120px; */
  box-sizing: border-box;
  /* border-left: 3px solid transparent; */
  /* Improve text readability */
  line-height: 1.5;
}

.containerChildTextDiv:hover {
  background-color: #f8f9fa;
  border-left-color: #15669d;
}

.selected .containerChildTextDiv {
  background-color: #e3f2fd;
  border-left-color: #15669d;
  box-shadow: inset 0 0 0 1px rgba(21, 102, 157, 0.2);
}

/* Radio Button Styles */
.mapRadioBtn {
  margin-right: 12px;
  margin-top: 4px;
  width: 16px;
  height: 16px;
  accent-color: #15669d;
  cursor: pointer;
  flex-shrink: 0;
}

/* Label Styles */
.shipany-label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  width: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Location Content */
/* .locationName {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 8px 0;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
} */

/* .operatingTime {
  font-size: 12px;
  color: #666666;
  margin: 0 0 4px 0;
  line-height: 1.3;
} */

.operatingTime.display-block {
  display: block !important;
}

/* .contentAddress {
  font-size: 13px;
  color: #555555;
  margin: 0 0 4px 0;
  line-height: 1.3;
} */

.contentAddress.display-block {
  display: block !important;
}

/* .contentCity {
  font-size: 13px;
  color: #666666;
  margin: 4px 0 0 0;
  line-height: 1.3;
  font-weight: 500;
} */

.contentCity.display-none {
  display: none !important;
}

/* .contentLocationType {
  font-size: 12px;
  color: #15669d;
  margin: 4px 0 0 0;
  line-height: 1.3;
  font-weight: 500;
} */

.contentLocationType.display-block {
  display: block !important;
}

/* Scrolling State */
.virtual-scroll-container.scrolling .virtual-scroll-item {
  pointer-events: none;
}

.virtual-scroll-container.scrolling {
  /* Disable transitions during scrolling for better performance */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Loading State */
.virtual-scroll-container.loading {
  opacity: 0.7;
}

.virtual-scroll-container.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #15669d;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 10;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Empty State */
.virtual-scroll-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #999999;
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .containerChildTextDiv {
    padding: 10px 12px;
    min-height: 100px;
  }
  
  .mapRadioBtn {
    margin-right: 8px;
  }
  
  /* .locationName {
    font-size: 13px;
  }
  
  .operatingTime,
  .contentAddress,
  .contentCity,
  .contentLocationType {
    font-size: 11px;
  } */
}

/* High DPI / Retina Display */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .virtual-scroll-container {
    border-width: 0.5px;
  }
  
  .containerChildTextDiv {
    border-bottom-width: 0.5px;
  }
}



/* Focus Styles for Accessibility */
.containerChildTextDiv:focus,
.mapRadioBtn:focus {
  outline: 2px solid #15669d;
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .containerChildTextDiv,
  .virtual-scroll-item {
    transition: none;
  }
  
  .virtual-scroll-container {
    scroll-behavior: auto;
  }
  
  .virtual-scroll-container.loading::after {
    animation: none;
  }
} 