/* 讓 timeline-container 永遠在地圖之上 */
#timeline-container {
    z-index: 10001 !important;
    position: fixed;
    left: 0;
    bottom: 0;
    height: 80px;
    width: 100vw;
}
/* Timeline highlight 沒用到？*/
.timeline-card-highlight {
    box-shadow: 0 0 0 4px #f59e42, 0 2px 8px #0003 !important;
    border-color: #f59e42 !important;
    background: #fffbe6 !important;
    transition: box-shadow 0.2s, border-color 0.2s, background 0.2s;
}

/* Pulse (Single Event) Animation */
.css-pulse {
    background: transparent;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.pulse-circle {
    width: 100%;
    height: 100%;
    background: #d63e2a;
    border-radius: 50%;
    opacity: 0;
    animation: pulse-flash 1.5s infinite;
}
@keyframes pulse-flash {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.5); }
}

/* Continuous Event Marker */
.continuous-marker {
    background: rgba(0, 123, 255, 0.7);
    border: 2px solid #007bff;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    text-align: center;
    line-height: 30px;
    white-space: nowrap;
    padding: 0 5px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}
.continuous-marker-content {
    overflow: hidden;
    text-overflow: ellipsis;
}
.continuous-marker-fade-in {
    opacity: 1;
}
.continuous-marker-fade-out {
    opacity: 0;
}
.continuous-marker-active {
    opacity: 1;
}

/* Custom Div Icon base styles */
.custom-div-icon {
    transform: translate(-50%, -50%);
    background: none !important;
    border: none !important;
}

/* Ghost card for drag */
.is-dragging {
    z-index: 10000 !important;
    position: absolute;
    background-color: white;
    padding: 0.5rem;
    border: 2px solid #d1d5db; /* gray-300, to match original card */
    border-radius: 0.25rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    pointer-events: none;

}


/* Tooltip for placed events */
.placed-event-marker {
    background-color: white;
    border: 2px solid #d1d5db; /* gray-300, to match original card */
    color: #374151;
    padding: 5px;
    border-radius: 3px;
    white-space: nowrap;
    font-weight: normal;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem; /* 8px */
}

/* Style for the year inside the marker */
.marker-year {
    font-size: 0.75rem; /* 12px */
    color: #6b7280; /* gray-500 */
    font-weight: normal;
}
/* Modifier for correctly placed event */
.placed-event-marker--correct {
    border-color: #22c55e; /* Green border */
    color: #166534; /* Darker green text */
}

/* Modifier for timeline highlighted event */
.placed-event-marker--highlight {
    border-color: #064d78; /* Orange border */
    background-color: #e8ee9f; /* Light yellow background */
    font-weight: bold;
    transform: scale(1.5) translateY(8px);
    border-radius: 10px;
}

.placed-event-marker--dimmed {
    opacity: 0.4;
    transform: scale(0.8);
}

/* Tooltip for locations */
.location-tooltip {
    padding: 3px;
    border-radius: 20px;
    white-space: nowrap;
    transition: opacity 0.3s; /* Only transition opacity on the container */
    border-width: 2px;
    border-style: solid;
}

.location-tooltip span {
    display: inline-block; /* Required for transform to apply */
}


.location-tooltip--guide-highlight {
  font-size: 1.5em;
  font-weight: bold;
  transition: font-size 0.2s;
  z-index: 9999 !important;
  
}

.location-tooltip--highlight {
    opacity: 1 !important;
    font-weight: bold;
    z-index: 1001 !important;
}

.location-tooltip--highlight span {
    transform: scale(1.5);
    /* 新增文字陰影來增加突出效果，取代會造成寬度跳變的 font-size 變更 */
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
    /* 新增淺色背景以突顯文字 */
    background-color: rgba(255, 255, 255, 0.85);
    padding: 2px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.location-tooltip--dimmed {
    opacity: 0.2 !important;
}

.location-tooltip--dimmed span {
    transform: scale(0.8);
    /* 確保在 dimmed 狀態下移除高亮樣式 */
    background-color: transparent;
    padding: 0;
    box-shadow: none;
    text-shadow: none;
}

.draggable-card {
  /*
    This is the key to solving the touch-drag issue.
    It tells the browser not to handle any default touch actions 
    (like scrolling or zooming) when a touch starts on this element.
  */
    touch-action: none;
    user-select: none;

}

/* Shake animation for incorrect card drop */
@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}
  /* --- Custom Timeline Slider for Touch-Friendliness --- */
.timeline-slider {
  -webkit-appearance: none; /* Hides the default slider look in WebKit */
  appearance: none;
  height: 24px; /* Set overall height to accommodate the larger thumb */  
  background: transparent; /* The track will provide the background */
  outline: none;
  cursor: pointer;
  position: fixed;  
}

/* Track for WebKit browsers (Chrome, Safari, Edge) */
.timeline-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 12px; /* Taller track */
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px #0003;
}

/* Thumb for WebKit browsers */
.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -6px; /* Vertically center the thumb on the track: (12px_track - 24px_thumb) / 2 */
  width: 24px;  /* Larger thumb */
  height: 24px; /* Larger thumb */
  background: #3b82f6; /* blue-500 */
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 4px rgba(0,0,0,0.5);
}

/* Track for Firefox */
.timeline-slider::-moz-range-track {
  width: 100%;
  height: 12px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px #0003;
}

/* Thumb for Firefox */
.timeline-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: #3b82f6;
  border-radius: 50%;
  border: none; /* Firefox adds a border by default */
  box-shadow: 0 0 4px rgba(0,0,0,0.5);
}