/* =========================================================================
   ABOUT TIMELINE — DESKTOP + RESPONSIVE
   ========================================================================= */

/* =========================================================================
   DESKTOP BASE
   ========================================================================= */

   .timeline-about {
    position: relative !important;
    background: #ffffff !important;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box;
    overflow: hidden;
    z-index: 1;
}

.timeline-about::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(255,255,255,0.8) 100%);
    pointer-events: none;
    z-index: 0;
}

/* --- Top waves --- */
.top-wave-wrapper {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 320px;
    overflow: hidden;
    z-index: 0;
    transform: rotate(180deg);
    pointer-events: none;
}

.waves-svg {
    position: relative;
    width: 100%; height: 100%;
    mask-image: linear-gradient(to top, black 30%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, black 30%, transparent 100%);
}

.moving-waves > use { animation: move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite; }
.moving-waves > use:nth-child(1) { animation-delay: -2s;  animation-duration: 7s;  }
.moving-waves > use:nth-child(2) { animation-delay: -3s;  animation-duration: 10s; }
.moving-waves > use:nth-child(3) { animation-delay: -4s;  animation-duration: 13s; }

@keyframes move-forever {
    0%   { transform: translate3d(-90px, 0, 0); }
    100% { transform: translate3d(85px,  0, 0); }
}

/* --- Bottom waves --- */
.glass-wave-container {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    z-index: -2;
    pointer-events: none;
}

.glass-wave {
    position: absolute;
    bottom: 0; left: 0;
    width: 200%; height: 100%;
    background-repeat: repeat-x;
    background-position: bottom;
    background-size: 50% auto;
}

.wave-back {
    height: 250px;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 800 88.7" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="g1" x1="0%25" y1="0%25" x2="0%25" y2="100%25"><stop offset="0%25" stop-color="%230642f6" stop-opacity="0.1"/><stop offset="100%25" stop-color="%230642f6" stop-opacity="0.3"/></linearGradient></defs><path d="M800 56.9c-155.5 0-204.9-50-405.5-49.9-200 0-250 49.9-394.5 49.9v31.8h800v-.2-31.6z" fill="url(%23g1)"/></svg>');
    animation: waveMove 25s linear infinite;
    z-index: 1;
    filter: drop-shadow(0 -5px 15px rgba(6,66,246,0.1));
}

.wave-mid {
    height: 200px;
    bottom: 10px;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 800 88.7" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="g2" x1="0%25" y1="0%25" x2="0%25" y2="100%25"><stop offset="0%25" stop-color="%233b82f6" stop-opacity="0.15"/><stop offset="100%25" stop-color="%233b82f6" stop-opacity="0.4"/></linearGradient></defs><path d="M800 56.9c-155.5 0-204.9-50-405.5-49.9-200 0-250 49.9-394.5 49.9v31.8h800v-.2-31.6z" fill="url(%23g2)"/></svg>');
    animation: waveMove 18s linear infinite reverse;
    z-index: 2;
    filter: drop-shadow(0 -5px 10px rgba(6,66,246,0.1));
}

.wave-front {
    height: 150px;
    bottom: -5px;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 800 88.7" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="g3" x1="0%25" y1="0%25" x2="0%25" y2="100%25"><stop offset="0%25" stop-color="%2360a5fa" stop-opacity="0.2"/><stop offset="100%25" stop-color="%2360a5fa" stop-opacity="0.5"/></linearGradient></defs><path d="M800 56.9c-155.5 0-204.9-50-405.5-49.9-200 0-250 49.9-394.5 49.9v31.8h800v-.2-31.6z" fill="url(%23g3)"/></svg>');
    animation: waveMove 12s linear infinite;
    z-index: 3;
    filter: drop-shadow(0 -5px 5px rgba(255,255,255,0.5));
    backdrop-filter: blur(2px);
}

@keyframes waveMove {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- Desktop Header --- */
.timeline-header {
    text-align: center;
    margin-bottom: 20px;
    z-index: 10;
    flex-shrink: 0;
}
.timeline-header h2 { font-size: 2.2rem;  color: #02258e; font-weight: 700; margin-bottom: 5px; }
.timeline-header p  { font-size: 0.95rem; color: #666;    font-weight: 400; }

/* --- Desktop Wrapper & container --- */
.timeline-wrapper {
    position: relative;
    width: 100%;
    max-width: 1600px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    flex-grow: 1;
}

.timeline-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 15px;
    z-index: 5;
    padding: 0 40px;
}

.timeline-line {
    position: absolute;
    top: 50%; left: 20px; right: 20px;
    height: 3px;
    background: #02258e;
    transform: translateY(-50%);
    z-index: 2;
}

.timeline-item {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 5;
}

.timeline-item:hover,
.timeline-item:has(.timeline-circle.active) { z-index: 9999 !important; }

/* --- Connectors --- */
.connector-line {
    position: absolute;
    width: 2px;
    background: #0642f6;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    flex-shrink: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.timeline-top    .timeline-circle  { order: 1; }
.timeline-top    .timeline-content { order: 3; }
.timeline-top    .connector-line   { bottom: 50%; height: 80px; }

.timeline-bottom .timeline-content { order: 1; }
.timeline-bottom .timeline-circle  { order: 3; }
.timeline-bottom .connector-line   { top: 50%; height: 80px; }

/* --- Circle dot --- */
@keyframes circlePulse {
    0%   { border-color: #0642f6; box-shadow: 0 0 0px   rgba(6,66,246,0); }
    50%  { border-color: #ffbf00; box-shadow: 0 0 15px  rgba(255,191,0,0.6); }
    100% { border-color: #0642f6; box-shadow: 0 0 0px   rgba(6,66,246,0); }
}

.timeline-circle {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 20px; height: 20px;
    background: #fff;
    border: 3px solid #0642f6;
    border-radius: 50%;
    z-index: 4;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: circlePulse 1.5s infinite;
}

.timeline-circle.active,
.timeline-item:hover .timeline-circle {
    animation: none;
    transform: translate(-50%, -50%) scale(1.5);
    border-color: #ffbf00;
    background: #ffbf00;
    box-shadow: 0 0 12px rgba(255,191,0,0.5);
}

/* --- Static labels --- */
.timeline-content {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    text-align: center;
    z-index: 6;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.timeline-top    .timeline-content { bottom: calc(50% + 90px); }
.timeline-bottom .timeline-content { top:    calc(50% + 90px); }

.timeline-content h3 { font-size: 1.5rem;  color: #02258e; font-weight: 800; margin-bottom: 4px; line-height: 1;   }
.timeline-content h4 { font-size: 0.95rem; color: #333;    font-weight: 700; margin-bottom: 0;   line-height: 1.3; }

.timeline-item:hover .timeline-content,
.timeline-item:has(.timeline-circle.active) .timeline-content { opacity: 0; visibility: hidden; }

/* Opposite-side hide rules */
.timeline-container:has(.timeline-top:hover) .timeline-bottom .timeline-content,
.timeline-container:has(.timeline-top .timeline-circle.active) .timeline-bottom .timeline-content,
.timeline-container:has(.timeline-top:hover) .timeline-bottom .connector-line,
.timeline-container:has(.timeline-top .timeline-circle.active) .timeline-bottom .connector-line,
.timeline-container:has(.timeline-top:hover) .timeline-bottom .timeline-circle,
.timeline-container:has(.timeline-top .timeline-circle.active) .timeline-bottom .timeline-circle { opacity: 0 !important; visibility: hidden !important; }

.timeline-container:has(.timeline-bottom:hover) .timeline-top .timeline-content,
.timeline-container:has(.timeline-bottom .timeline-circle.active) .timeline-top .timeline-content,
.timeline-container:has(.timeline-bottom:hover) .timeline-top .connector-line,
.timeline-container:has(.timeline-bottom .timeline-circle.active) .timeline-top .connector-line,
.timeline-container:has(.timeline-bottom:hover) .timeline-top .timeline-circle,
.timeline-container:has(.timeline-bottom .timeline-circle.active) .timeline-top .timeline-circle { opacity: 0 !important; visibility: hidden !important; }

/* --- Desktop popup --- */
.timeline-hover-box {
    position: absolute;
    width: 950px !important;
    max-width: none !important;
    height: auto !important;
    padding: 0 !important;
    gap: 35px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    z-index: 999999 !important;
    display: flex;
    flex-direction: row;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.timeline-hover-box::after,
.timeline-hover-box::before { display: none !important; }

.timeline-top    .timeline-hover-box { top:    70px !important; bottom: auto !important; transform: translateX(-50%) translateY(10px);  }
.timeline-bottom .timeline-hover-box { bottom: 70px !important; top:    auto !important; transform: translateX(-50%) translateY(-10px); }

.timeline-item:hover .timeline-hover-box,
.timeline-item:has(.timeline-circle.active) .timeline-hover-box {
    opacity: 1; visibility: visible; pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* --- Desktop Popup content --- */
.popup-img { flex: 0 0 90px; width: 90px; height: 90px; object-fit: contain; }
.popup-content { flex: 1; text-align: left; }
.popup-year  { font-size: 1.3rem  !important; color: #0642f6 !important; font-weight: 800 !important; margin-bottom: 4px !important; line-height: 1   !important; }
.popup-title { font-size: 1.05rem !important; color: #222    !important; font-weight: 700 !important; margin-bottom: 6px !important; line-height: 1.2 !important; }
.popup-content p { font-size: 0.85rem !important; color: #444 !important; line-height: 1.6 !important; margin: 0 !important; }

/* Mobile dots — hidden on desktop */
.mobile-timeline-dots { display: none; }

/* =========================================================================
   TABLET  (768px – 1050px)
   ========================================================================= */
@media (min-width: 768px) and (max-width: 1050px) {
    .timeline-about { padding: 30px 15px; }
    .timeline-header h2 { font-size: 1.75rem; }
    .timeline-header p  { font-size: 0.85rem; }
    .timeline-wrapper   { min-height: 400px; }
    .timeline-container { gap: 8px; padding: 0 20px; }
    .timeline-content   { width: 130px; }
    .timeline-content h3 { font-size: 1.05rem; }
    .timeline-content h4 { font-size: 0.75rem; }
    .timeline-top    .timeline-content { bottom: calc(50% + 72px); }
    .timeline-bottom .timeline-content { top:    calc(50% + 72px); }
    .timeline-top    .connector-line   { height: 58px; }
    .timeline-bottom .connector-line   { height: 58px; }
    .timeline-hover-box { width: 86vw !important; gap: 22px; }
    .timeline-top    .timeline-hover-box { top:    60px !important; }
    .timeline-bottom .timeline-hover-box { bottom: 60px !important; }
    .popup-img   { flex: 0 0 68px; width: 68px; height: 68px; border-radius: 10px; }
    .popup-year  { font-size: 1.1rem  !important; }
    .popup-title { font-size: 0.9rem  !important; }
    .popup-content p { font-size: 0.78rem !important; }
}

/* =========================================================================
   MOBILE  (<=767px)
   ========================================================================= */
@media (max-width: 767.98px) {

    /* ── Section ── */
    .timeline-about {
        position: relative;
        height: 100dvh;
        min-height: 600px;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        background: linear-gradient(180deg,
            #dde8ff 0%,
            #eef3ff 35%,
            #f7f9ff 55%,
            #dce9ff 100%) !important;
        box-sizing: border-box;
    }

    /* ── Top wave ── */
    .top-wave-wrapper {
        position: absolute;
        top: 0; left: 0;
        width: 100%;
        height: 130px;
        overflow: hidden;
        z-index: 2;
        transform: none;
        pointer-events: none;
    }
    .top-wave-wrapper .waves-svg {
        transform: scaleY(-1);
        width: 100%;
        height: 100%;
        mask-image: none;
        -webkit-mask-image: none;
    }

    /* ── Bottom wave ── */
    .glass-wave-container { z-index: 2; pointer-events: none; }
    .wave-back  { height: 130px; }
    .wave-mid   { height: 100px; bottom: 0; }
    .wave-front { height:  75px; bottom: 0; }

    /* ── HEADING: absolute, overlaps wave, never touches card ── */
    .timeline-header {
        position: absolute;
        top: 100px;
        left: 0; right: 0;
        z-index: 3;
        text-align: center;
        padding: 0 24px;
        box-sizing: border-box;
        pointer-events: none;
    }
    .timeline-header h2 {
        font-size: 1.5rem;
        color: #02258e;
        font-weight: 700;
        margin-bottom: 4px;
        line-height: 1.2;
    }
    .timeline-header p {
        font-size: 0.8rem;
        color: #444;
        font-weight: 400;
    }

    /* ── Hide desktop chrome ── */
    .timeline-line,
    .connector-line,
    .timeline-content { display: none !important; }

    /* ── WRAPPER: fills entire section, centers card ── */
    .timeline-wrapper {
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        z-index: 4;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: transparent !important;
        border: none !important;
        outline: none !important;
    }

    /* ── CAROUSEL: transparent, no borders, no background ── */
    .timeline-container {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: scroll !important;
        overflow-y: visible !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        width: 100% !important;
        gap: 0 !important;
        padding: 0 !important;
        align-items: center !important;
        position: static !important;
        touch-action: pan-x !important;
        overscroll-behavior-x: contain !important;
        flex-shrink: 0 !important;
        background: transparent !important;
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
    }
    .timeline-container::-webkit-scrollbar { display: none; }

    /* ── SLIDE: transparent, fixed height so all cards are same size ── */
    .timeline-item {
        flex: 0 0 100% !important;
        width: 100% !important;
        min-width: 100% !important;
        height: 520px !important;
        scroll-snap-align: start !important;
        position: static !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 20px !important;
        box-sizing: border-box !important;
        z-index: auto !important;
        background: transparent !important;
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
    }

    .timeline-item:hover,
    .timeline-item:has(.timeline-circle.active) { z-index: auto !important; }

    /* ── Circle → transparent flex shell ── */
    .timeline-circle {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        height: 100% !important;
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        animation: none !important;
        cursor: default !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        transition: none !important;
        outline: none !important;
    }
    .timeline-circle.active,
    .timeline-item:hover .timeline-circle {
        position: static !important;
        transform: none !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        animation: none !important;
        outline: none !important;
    }

    /* ── Card entrance animations ── */
    @keyframes slideFromRight {
        from { opacity: 0; transform: translateX(36px) scale(0.97); }
        to   { opacity: 1; transform: translateX(0)    scale(1);    }
    }
    @keyframes slideFromLeft {
        from { opacity: 0; transform: translateX(-36px) scale(0.97); }
        to   { opacity: 1; transform: translateX(0)     scale(1);    }
    }

    /* ── THE CARD: fixed height = same for all slides ── */
    .timeline-hover-box {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
        transition: none !important;

        /* Fixed dimensions — same on every slide */
        width: calc(100% - 16px) !important;
        max-width: 360px !important;
        height: 350px !important;
        min-height: unset !important;
        max-height: unset !important;

        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        text-align: center !important;
        padding: 28px 26px 24px !important;
        gap: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;

        background: rgba(255, 255, 255, 0.97) !important;
        border: 1.5px solid rgba(6, 66, 246, 0.12) !important;
        border-radius: 26px !important;
        box-shadow:
            0 10px 48px rgba(6, 66, 246, 0.14),
            0 2px  12px rgba(0,   0,   0, 0.06) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        z-index: 5 !important;
        flex-shrink: 0 !important;
        margin-top: 30px !important;
    }

    .timeline-hover-box.card-enter-right {
        animation: slideFromRight 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    }
    .timeline-hover-box.card-enter-left {
        animation: slideFromLeft 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    }

    .timeline-item:hover .timeline-hover-box,
    .timeline-item:has(.timeline-circle.active) .timeline-hover-box {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }

    /* Reset desktop hide rules */
    .timeline-container:has(.timeline-top:hover) .timeline-bottom .timeline-circle,
    .timeline-container:has(.timeline-top .timeline-circle.active) .timeline-bottom .timeline-circle,
    .timeline-container:has(.timeline-bottom:hover) .timeline-top .timeline-circle,
    .timeline-container:has(.timeline-bottom .timeline-circle.active) .timeline-top .timeline-circle {
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* ── Card image ── */
    .popup-img {
        flex: none !important;
        width: 80px !important;
        height: 80px !important;
        object-fit: contain !important;
        margin-bottom: 10px !important;
        filter: drop-shadow(0 4px 12px rgba(6, 66, 246, 0.16));
        flex-shrink: 0 !important;
        border-radius: 10px;
    }

    /* ── Card text ── */
    .popup-content {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        text-align: center !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        overflow: hidden !important;
    }
    .popup-year {
        font-size: 1.9rem !important;
        color: #0642f6 !important;
        font-weight: 800 !important;
        margin-bottom: 4px !important;
        line-height: 1 !important;
        display: block !important;
        flex-shrink: 0 !important;
    }
    .popup-title {
        font-size: 1rem !important;
        color: #111 !important;
        font-weight: 700 !important;
        margin-bottom: 10px !important;
        line-height: 1.3 !important;
        display: block !important;
        flex-shrink: 0 !important;
    }
    .popup-content p {
        font-size: 0.83rem !important;
        line-height: 1.65 !important;
        color: #555 !important;
        display: block !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none !important;
        margin: 0 !important;
        text-align: center !important;
        flex: 1 1 0 !important;
        min-height: 0 !important;
        width: 100% !important;
    }
    .popup-content p::-webkit-scrollbar { display: none; }

    /* ── DOTS: absolute, overlaps bottom wave, never touches card ── */
    .mobile-timeline-dots {
        display: flex !important;
        justify-content: center;
        align-items: center;
        gap: 9px;
        position: absolute;
        bottom: 90px;
        left: 0; right: 0;
        z-index: 3;
        pointer-events: auto;
        width: 100%;
        background: transparent !important;
        border: none !important;
    }

    .mobile-timeline-dots .dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(6, 66, 246, 0.30);
        border: 1.5px solid rgba(6, 66, 246, 0.60);
        cursor: pointer;
        transition:
            background    0.25s ease,
            width         0.25s ease,
            border-radius 0.25s ease,
            border-color  0.25s ease;
        flex-shrink: 0;
    }

    .mobile-timeline-dots .dot.active {
        background: #0642f6;
        border-color: #0642f6;
        width: 26px;
        border-radius: 4px;
    }
}

/* =========================================================================
   VERY SMALL PHONES  (<=380px)
   ========================================================================= */
@media (max-width: 380px) {
    .timeline-header    { top: 88px; }
    .timeline-header h2 { font-size: 1.25rem; }
    .timeline-header p  { font-size: 0.73rem; }
    .timeline-item      { padding: 0 14px !important; height: 440px !important; }
    .timeline-hover-box {
        max-width: 308px !important;
        height: 320px !important;
        padding: 22px 18px 20px !important;
        border-radius: 22px !important;
    }
    .popup-img          { width: 68px !important; height: 68px !important; margin-bottom: 8px !important; }
    .popup-year         { font-size: 1.65rem !important; }
    .popup-title        { font-size: 0.9rem !important; margin-bottom: 8px !important; }
    .popup-content p    { font-size: 0.77rem !important; }
    .mobile-timeline-dots { bottom: 76px; }
}