.toggle-rotated {
    -moz-transform:rotate(90deg);
    -webkit-transform:rotate(90deg);
    -o-transform:rotate(90deg);
    -ms-transform:rotate(90deg);
    transform:rotate(90deg);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-rotated-reverse {
    -moz-transform:rotate(0deg);
    -webkit-transform:rotate(0deg);
    -o-transform:rotate(0deg);
    -ms-transform:rotate(0deg);
    transform:rotate(0deg);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.lm-itinerary-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 40px 0;
}

.lm-itinerary-left, .lm-itinerary-right {
    padding: 0;
}

.lm-itinerary-right {
    position: sticky;
    top: 40px;
    height: fit-content;
    max-height: calc(100vh - 40px);
}


.lm-itinerary-list {
    position: relative;
    display: flex;
    flex-direction: column;
}


.lm-itinerary-item {
    position: relative;
    padding-left: 50px;
}

.lm-itinerary-item:last-child .lm-itinerary-connector {
    display: none;
}


.lm-itinerary-marker {
    position: absolute;
    left: 0;
    top: 24px;
    z-index: 2;
}

.lm-itinerary-marker .marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--ast-global-color-5, #ffffff);
    font-size: 14px;
    font-weight: 700;
    border: 2px solid var(--ast-global-color-5, #ffffff);
}

.marker.start {
    background: var(--ast-global-color-0, #f37021);
}

.marker.end {
    background: var(--ast-global-color-1, #be5b1f);
}

.marker.waypoint {
    background: var(--ast-global-color-3, #353535);
}


.lm-itinerary-connector {
    position: absolute;
    left: 17px;
    top: 44px;
    bottom: -40px;
    width: 2px;
    background-image: linear-gradient(to bottom, var(--ast-global-color-6, #e5d7d1) 50%, transparent 50%);
    background-size: 2px 8px;
    z-index: 1;
}

.driving-time-on-line {
    position: absolute;
    left: 0px;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    min-width: 60px;
    text-align: center;
}

.driving-time-on-line .time {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ast-global-color-2);
    line-height: 1;
    margin-bottom: 1px;
}

.driving-time-on-line .distance {
    font-size: 0.8rem;
    color: var(--ast-global-color-8);
    line-height: 1;
}


.lm-itinerary-content {
    padding: 0;
}

.lm-itinerary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 24px 0;
    border-bottom: 1px solid var(--ast-global-color-6, #e5d7d1);
    transition: background-color 0.2s ease;
}

.lm-itinerary-header h4 {
    margin: 0;
    color: var(--ast-global-color-2, #1c0d0a);
    flex-grow: 1;
}

.lm-itinerary-header .duration {
    color: var(--ast-global-color-8, #222222);
    font-size: 1rem;
    margin: 0 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
}

.lm-itinerary-header .toggle-icon {
    color: var(--ast-global-color-0, #f37021);
    font-size: 18px;
    font-family: 'icofont' !important;
}


.lm-itinerary-header[aria-expanded="true"] .toggle-icon {
    color: var(--ast-global-color-1, #be5b1f);
}


.lm-itinerary-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, margin-top 0.3s ease-out, padding 0.3s ease-out;
    margin-top: 0;
    padding: 0 0;
}

.lm-itinerary-details.active {
    max-height: 600px;
    margin-top: 16px;
    padding: 16px 0;
}

.lm-itinerary-details .itinerary-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 16px;
}

.lm-itinerary-details .description {
    color: var(--ast-global-color-8, #222222);
    line-height: 1.7;
    font-size: 16px;
    margin-bottom: 16px;
}

.lm-itinerary-details .google-maps-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ast-global-color-0, #f37021);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}


.lm-itinerary-map {
    height: 400px;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    position: relative;
}

.lm-map-loading, .lm-map-error, .lm-map-notice {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    padding: 20px;
}

.lm-map-loading::before {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--ast-global-color-6, #e5d7d1);
    border-top-color: var(--ast-global-color-0, #f37021);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


.info-window {
    padding: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.info-window h4 {
    text-align: center;
    margin: 0;
    padding: 0;
    font-weight: 600;
    color: var(--ast-global-color-2, #0F3460);
}

.info-window p {
    margin: 4px 0;
    font-size: 14px;
    color: var(--ast-global-color-8, #222222);
}


@media (max-width: 782px) {
    .lm-itinerary-container {
        grid-template-columns: 1fr;
        gap: 24px;
        margin: 24px 0;
    }
    
    .lm-itinerary-right {
        position: static;
        height: auto;
        max-height: none;
    }
    
    .lm-itinerary-map {
        height: 300px;
    }
}

@keyframes marker-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.marker-pulse {
    animation: marker-pulse 1.5s ease-in-out 2;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.marker-bounce {
    animation: bounce 1s ease-in-out 3;
}

/* 多日遊樣式增強 */
.lm-day-header {
    margin: 30px 0 15px 0;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    transition: all 0.3s ease;
}

.lm-day-header:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.lm-day-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lm-day-header h4:before {
    content: '📅';
    font-size: 16px;
}

.lm-day-header p {
    margin: 12px 0 0 0;
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.5;
}

.lm-day-header:first-child {
    margin-top: 0;
}

/* 多日遊行程列表間距 */
.lm-itinerary-list[data-day] {
    margin-bottom: 40px;
    position: relative;
}

.lm-itinerary-list[data-day]:not(:last-child):after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 17px;
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, transparent 0%, var(--ast-global-color-6, #e5d7d1) 20%, var(--ast-global-color-6, #e5d7d1) 80%, transparent 100%);
    opacity: 0.3;
}

/* 多日遊項目的特殊樣式 */
.lm-itinerary-item[data-day] .marker {
    position: relative;
    overflow: visible;
}

.lm-itinerary-item[data-day] .marker:after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.1;
    z-index: -1;
    transition: all 0.3s ease;
}

.lm-itinerary-item[data-day]:hover .marker:after {
    opacity: 0.2;
    transform: scale(1.1);
}

/* 響應式調整 */
@media (max-width: 782px) {
    .lm-day-header {
        margin: 20px 0 10px 0;
        padding: 12px;
    }
    
    .lm-day-header h4 {
        font-size: 16px;
    }
    
    .lm-itinerary-list[data-day] {
        margin-bottom: 30px;
    }
}


@media (min-width: 783px) {
    .lm-itinerary-container.scrolled .lm-itinerary-right {
        position: fixed;
        top: 20px;
        right: calc((100vw - 100%) / 2);
        width: calc((100% - 40px) / 2);
        z-index: 100;
    }
    
    
    .lm-itinerary-container.scrolled .lm-itinerary-left {
        margin-right: calc((100% + 40px) / 2);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.marker-bounce {
    animation: bounce 1s ease-in-out 3;
}

/* 多日遊樣式增強 */
.lm-day-header {
    margin: 30px 0 15px 0;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    transition: all 0.3s ease;
}

.lm-day-header:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.lm-day-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lm-day-header h4:before {
    content: '📅';
    font-size: 16px;
}

.lm-day-header p {
    margin: 12px 0 0 0;
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.5;
}

.lm-day-header:first-child {
    margin-top: 0;
}

/* 多日遊行程列表間距 */
.lm-itinerary-list[data-day] {
    margin-bottom: 40px;
    position: relative;
}

.lm-itinerary-list[data-day]:not(:last-child):after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 17px;
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, transparent 0%, var(--ast-global-color-6, #e5d7d1) 20%, var(--ast-global-color-6, #e5d7d1) 80%, transparent 100%);
    opacity: 0.3;
}

/* 多日遊項目的特殊樣式 */
.lm-itinerary-item[data-day] .marker {
    position: relative;
    overflow: visible;
}

.lm-itinerary-item[data-day] .marker:after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.1;
    z-index: -1;
    transition: all 0.3s ease;
}

.lm-itinerary-item[data-day]:hover .marker:after {
    opacity: 0.2;
    transform: scale(1.1);
}

/* 響應式調整 */
@media (max-width: 782px) {
    .lm-day-header {
        margin: 20px 0 10px 0;
        padding: 12px;
    }
    
    .lm-day-header h4 {
        font-size: 16px;
    }
    
    .lm-itinerary-list[data-day] {
        margin-bottom: 30px;
    }
    .lm-itinerary-item {
        padding-left: 40px;
    }
    .lm-itinerary-header .duration {
        margin: 0 6px;
        gap: 3px;
    }
}
