/* ----------------------------------- */
/* #CIRCUIT TIMELINE
/* ----------------------------------- */

.circuit {
    background: linear-gradient(180deg, #F4E4D7 0%, #FFFCFB 100%);
    padding-block: 80px;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.circuit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #D4A574, transparent);
}

.circuit .section-subtitle {
    text-align: center;
    color: #4A90E2;
}

.circuit .section-title {
    text-align: center;
    margin-bottom: 60px;
}

.circuit-timeline {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 0;
}

.circuit-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='80' viewBox='0 0 40 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20,0 Q35,20 20,40 Q5,60 20,80' fill='none' stroke='%234A90E2' stroke-width='3' stroke-linecap='round' stroke-dasharray='6,8'/%3E%3C/svg%3E");
    background-position: center top;
    background-repeat: repeat-y;
    z-index: 1;
    opacity: 0.6;
}

.timeline-item {
    position: relative;
    display: flex;
    justify-content: flex-end;
    padding-bottom: 80px;
    /* Increased spacing */
    width: 50%;
    opacity: 0;
    animation: slideIn 0.6s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-item:nth-child(1) {
    animation-delay: 0.1s;
}

.timeline-item:nth-child(2) {
    animation-delay: 0.2s;
}

.timeline-item:nth-child(3) {
    animation-delay: 0.3s;
}

.timeline-item:nth-child(4) {
    animation-delay: 0.4s;
}

.timeline-item:nth-child(5) {
    animation-delay: 0.5s;
}

.timeline-item:nth-child(odd) {
    align-self: flex-start;
    text-align: right;
    padding-right: 50px;
    left: 0;
}

.timeline-item:nth-child(even) {
    align-self: flex-end;
    text-align: left;
    padding-left: 50px;
    left: 50%;
    justify-content: flex-start;
}

.timeline-marker {
    position: absolute;
    top: 25px;
    width: 20px;
    /* Reduced size */
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A90E2 0%, #6BA3E8 100%);
    border: 4px solid #FFFCFB;
    z-index: 2;
    box-shadow: 0 0 0 6px rgba(74, 144, 226, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-marker {
    transform: scale(1.3);
    box-shadow: 0 0 0 8px rgba(74, 144, 226, 0.3),
        0 6px 16px rgba(74, 144, 226, 0.4);
}

.timeline-item:nth-child(odd) .timeline-marker {
    right: -12px;
}

.timeline-item:nth-child(even) .timeline-marker {
    left: -12px;
}

.timeline-content {
    background: #FFFCFB;
    padding: 35px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    width: 100%;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 5;
    /* Above the lines */
    border: 1px solid rgba(212, 165, 116, 0.15);
}

.timeline-content:hover {
    transform: translateY(-8px) scale(1.02);
    background: #ffffff;
    /* Explicit White on Hover */
    box-shadow: 0 20px 40px rgba(74, 144, 226, 0.15);
    border-color: #4A90E2;
}

.timeline-item:nth-child(odd) .timeline-content::after {
    content: '';
    position: absolute;
    top: 28px;
    right: -12px;
    width: 24px;
    height: 24px;
    background: #FFFCFB;
    transform: rotate(45deg);
    border-right: 1px solid rgba(212, 165, 116, 0.2);
    border-top: 1px solid rgba(212, 165, 116, 0.2);
    z-index: -1;
}

.timeline-item:nth-child(even) .timeline-content::after {
    content: '';
    position: absolute;
    top: 28px;
    left: -12px;
    width: 24px;
    height: 24px;
    background: #FFFCFB;
    transform: rotate(45deg);
    border-left: 1px solid rgba(212, 165, 116, 0.2);
    border-bottom: 1px solid rgba(212, 165, 116, 0.2);
    z-index: -1;
}

.day-badge {
    display: inline-block;
    background: linear-gradient(135deg, #4A90E2 0%, #2E5C8A 100%);
    color: #FFFCFB;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.timeline-title {
    color: #1A2530;
    font-size: 2.2rem;
    /* Much larger */
    margin-bottom: 18px;
    font-family: 'Heebo', sans-serif;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.timeline-text {
    color: #3B4858;
    line-height: 1.8;
    margin-bottom: 25px;
    font-size: 1.8rem;
    /* Matched to daily tours standard */
}

.timeline-footer {
    border-top: 1px solid rgba(212, 165, 116, 0.2);
    padding-top: 20px;
    font-size: 1.3rem;
    /* Increased */
    color: #34495E;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-item:nth-child(odd) .timeline-footer {
    justify-content: flex-end;
}

.stay-location ion-icon,
.end-tour ion-icon {
    color: #4A90E2;
    font-size: 1.2rem;
    vertical-align: middle;
}

.end-tour {
    color: #4A90E2;
    font-weight: 700;
}

.end-tour ion-icon {
    color: #4A90E2;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .circuit {
        padding-block: 60px;
    }

    .circuit .section-title {
        margin-bottom: 36px;
        font-size: clamp(1.9rem, 5vw, 2.4rem);
    }

    .circuit-timeline {
        padding: 24px 0;
    }

    .circuit-timeline::before {
        left: 30px;
    }

    .timeline-item {
        width: 100%;
        align-self: flex-start;
        padding-left: 70px;
        padding-right: 0;
        padding-bottom: 50px;
        text-align: left;
        margin-bottom: 0;
    }

    .timeline-item:nth-child(odd) {
        text-align: left;
        padding-right: 0;
        left: 0;
        justify-content: flex-start;
    }

    .timeline-item:nth-child(even) {
        left: 0;
    }

    .timeline-marker {
        left: 18px !important;
        right: auto !important;
    }

    .timeline-content {
        padding: 24px 20px;
    }

    .timeline-title {
        font-size: 1.9rem;
        margin-bottom: 12px;
    }

    .timeline-text {
        font-size: 1.6rem;
        margin-bottom: 16px;
    }

    .timeline-item:nth-child(odd) .timeline-content::after,
    .timeline-item:nth-child(even) .timeline-content::after {
        left: -12px;
        right: auto;
        border-right: none;
        border-top: none;
        border-left: 1px solid rgba(212, 165, 116, 0.2);
        border-bottom: 1px solid rgba(212, 165, 116, 0.2);
    }

    .timeline-item:nth-child(odd) .timeline-footer {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .circuit {
        padding-block: 40px;
    }

    .circuit-timeline {
        padding: 16px 0;
    }

    .circuit-timeline::before {
        left: 14px;
    }

    .timeline-item {
        padding-left: 52px;
        padding-bottom: 36px;
    }

    .timeline-marker {
        left: 6px !important;
        width: 16px;
        height: 16px;
        border-width: 3px;
    }

    .timeline-content {
        padding: 18px 14px;
    }

    .timeline-title {
        font-size: 1.7rem;
        margin-bottom: 10px;
    }

    .timeline-text {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }

    .day-badge {
        font-size: 0.8rem;
        padding: 6px 14px;
        margin-bottom: 10px;
    }

    .timeline-footer {
        padding-top: 14px;
        font-size: 1.2rem;
    }
}

/* Horizontal Layout for Desktop (Snake Circuit 2-Col) */
@media (min-width: 992px) {
    .circuit-timeline {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 60px 80px;
        padding-top: 50px;
        padding-bottom: 50px;
        position: relative;
        max-width: 900px;
        margin: 0 auto;
    }

    .circuit-timeline::before {
        display: none;
        /* Remove single line */
    }

    /* Grid Positioning */
    /* Row 1: 1 -> 2 */
    .timeline-item:nth-child(1) {
        grid-area: 1 / 1;
    }

    .timeline-item:nth-child(2) {
        grid-area: 1 / 2;
    }

    /* Row 2: 4 <- 3 */
    /* Flow: 2 -> 3 (Down) -> 4 (Left) */
    .timeline-item:nth-child(3) {
        grid-area: 2 / 2;
    }

    .timeline-item:nth-child(4) {
        grid-area: 2 / 1;
    }

    /* Row 3: 5 (Left aligned) */
    /* Flow: 4 -> 5 (Down) */
    .timeline-item:nth-child(5) {
        grid-area: 3 / 1;
    }

    .timeline-item {
        width: 100%;
        margin: 0;
        padding: 0 15px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Reset Styles */
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        align-self: center;
        text-align: center;
        padding: 0 15px;
        left: auto;
        justify-content: center;
    }

    .timeline-marker {
        position: relative;
        left: auto !important;
        right: auto !important;
        top: 0;
        margin: 0 auto 20px;
        width: 40px;
        height: 40px;
        border-width: 4px;
        box-shadow: 0 0 0 5px #FFFCFB, 0 4px 12px rgba(0, 0, 0, 0.1);
        z-index: 2;
    }

    .timeline-text {
        font-size: 1.8rem;
        /* Matched to daily tours standard */
        line-height: 1.8;
        margin-bottom: 20px;
        color: #3B4858;
    }

    .timeline-content {
        background: #ffffff;
        padding: 30px;
        border-radius: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
        border: 1px solid rgba(212, 165, 116, 0.15);
        width: 100%;
        margin-top: 20px;
        transition: all 0.3s ease;
        position: relative;
        z-index: 5;
        /* Above the lines */
    }

    .timeline-content:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 35px rgba(74, 144, 226, 0.15);
        border-color: #4A90E2;
    }

    .timeline-content::after {
        display: none !important;
    }

    .day-badge {
        margin-bottom: 15px;
        font-size: 1rem;
    }

    /* CONNECTING LINES */

    /* Horizontal Right (1->2) */
    .timeline-item:nth-child(1)::after {
        content: '';
        position: absolute;
        top: 20px;
        /* Center of marker */
        left: 50%;
        width: calc(100% + 80px);
        height: 40px;
        background-image: url("data:image/svg+xml,%3Csvg width='80' height='40' viewBox='0 0 80 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,20 Q20,5 40,20 Q60,35 80,20' fill='none' stroke='%234A90E2' stroke-width='3' stroke-linecap='round' stroke-dasharray='6,8'/%3E%3C/svg%3E");
        background-repeat: repeat-x;
        background-position: left center;
        z-index: 1;
        transform: translateY(-50%);
    }

    /* Horizontal Left (3->4) */
    .timeline-item:nth-child(3)::after {
        content: '';
        position: absolute;
        top: 20px;
        right: 50%;
        width: calc(100% + 80px);
        height: 40px;
        background-image: url("data:image/svg+xml,%3Csvg width='80' height='40' viewBox='0 0 80 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,20 Q20,5 40,20 Q60,35 80,20' fill='none' stroke='%234A90E2' stroke-width='3' stroke-linecap='round' stroke-dasharray='6,8'/%3E%3C/svg%3E");
        background-repeat: repeat-x;
        background-position: left center;
        z-index: 1;
        transform: translateY(-50%) rotate(180deg);
    }

    /* Vertical Down (2->3, 4->5) */
    .timeline-item:nth-child(2)::before,
    .timeline-item:nth-child(4)::before {
        content: '';
        position: absolute;
        top: 40px;
        /* Bottom of marker */
        left: calc(50% - 20px);
        width: 40px;
        height: calc(100% + 60px);
        background-image: url("data:image/svg+xml,%3Csvg width='40' height='80' viewBox='0 0 40 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20,0 Q35,20 20,40 Q5,60 20,80' fill='none' stroke='%234A90E2' stroke-width='3' stroke-linecap='round' stroke-dasharray='6,8'/%3E%3C/svg%3E");
        background-repeat: repeat-y;
        background-position: center top;
        z-index: 1;
    }
}