/* About Page - Journey Section */

/* Journey Section with Timeline */
.journey-section {
    position: relative;
    padding: 10rem 0 4rem;
    background-color: #121212;
    min-height: 90vh;
    overflow: hidden;
    background-attachment: fixed;
    will-change: transform;
    transform: translateZ(0);
}

.timeline-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    min-height: 400px;
    transition: min-height 0.3s ease;
}

/* Main timeline path */
.timeline-path {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(100, 255, 218, 0.3), rgba(142, 68, 173, 0.4));
    transform: translateY(-50%);
    z-index: 1;
    transition: all 0.4s ease;
}

/* Timeline milestone styling */
.timeline-milestone {
    position: absolute;
    z-index: 3;
    transition: all 0.4s ease;
}

.first-milestone {
    position: absolute;
    top: 50%;
    left: 10%; /* Moved further left from 15% to 10% */
    transform: translateY(-50%);
}

.second-milestone {
    position: absolute;
    top: 50%;
    left: 40%;
    transform: translateY(-50%);
}

.third-milestone {
    position: absolute;
    top: 50%;
    left: 65%;
    transform: translateY(-50%);
}

.fourth-milestone {
    position: absolute;
    top: 50%;
    left: 85%;
    transform: translateY(-50%);
}

/* Milestone dots that connect to the timeline */
.milestone-dot {
    position: absolute;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    top: 50%;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    z-index: 15; /* Higher z-index for dots to be more clickable */
}

/* Style for first milestone dot (teal theme) */
.first-milestone .milestone-dot {
    background: #64ffda;
    box-shadow: 0 0 15px rgba(100, 255, 218, 0.7);
}

.first-milestone .milestone-dot:hover {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 20px rgba(100, 255, 218, 0.9);
}

/* Style for second milestone dot (purple theme) */
.second-milestone .milestone-dot {
    background: #8e44ad;
    box-shadow: 0 0 15px rgba(142, 68, 173, 0.7);
}

.second-milestone .milestone-dot:hover {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 20px rgba(142, 68, 173, 0.9);
}

/* Style for third milestone dot (blue theme) */
.third-milestone .milestone-dot {
    background: #3498db;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.7);
}

.third-milestone .milestone-dot:hover {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.9);
}

/* Style for fourth milestone dot (red theme) */
.fourth-milestone .milestone-dot {
    background: #e74c3c;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.7);
}

.fourth-milestone .milestone-dot:hover {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.9);
}

/* Remove connecting lines from milestone dots */
.milestone-dot::before {
    display: none; /* Hide the connecting lines */
}

/* Base milestone content styling */
.milestone-content {
    padding: 1.5rem;
    border-radius: 8px;
    background: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(100, 255, 218, 0.2);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    position: absolute;
    min-width: 280px;
    min-height: 120px; /* Ensure minimum height for content */
    z-index: 10;
    max-width: 320px;
    bottom: 40px; /* Position above the dot for all milestones */
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    display: flex;  /* Use flexbox for better layout */
    flex-direction: column;
}

/* Make sure all milestone content has the same internal layout */
.milestone-date,
.milestone-title,
.milestone-text {
    width: 100%;
    margin-bottom: 0.5rem;
}

/* Ensure milestone-text has enough space */
.milestone-text {
    flex-grow: 1;
    min-height: 3rem;
}

.milestone-content::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 20px;
    height: 20px;
    background-color: rgba(18, 18, 18, 0.8);
    border-right: 1px solid rgba(100, 255, 218, 0.2);
    border-bottom: 1px solid rgba(100, 255, 218, 0.2);
    z-index: -1;
}

.milestone-content .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 2; /* Ensure it's above other content */
}

.milestone-content .close-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Remove any conflicting styles */
.launch-milestone::after,
.nightfall-milestone::after,
.enigma-milestone::after,
.projectx-milestone::after {
    display: none; /* This prevents any conflicting ::after styles */
}

/* Rocket container positioning - centered on timeline */
.rocket-container.left-positioned {
    position: absolute;
    top: 50%;
    left: 20%; /* Moved slightly to the left */
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 60px;
    height: 100px;
    pointer-events: none;
}

.rocket-container.left-positioned .rocket {
    transform: rotate(90deg);
    position: absolute;
    top: 50%;
    left: 30px;
    margin-top: -75px; /* Half of the rocket's height to vertically center it */
}

/* Rocket styling */
.rocket {
    position: relative;
    width: 60px;
    height: 150px;
    margin: 0 auto;
}

.rocket-body {
    position: absolute;
    width: 60px;
    height: 100px;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, #2b5876, #4e4376);
    border-radius: 50% / 10%;
    z-index: 3;
}

.rocket-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10px;
    width: 40px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.rocket-head {
    position: absolute;
    width: 60px;
    height: 60px;
    top: -30px;
    left: 0;
    background-color: #64ffda;
    border-radius: 50% 50% 20% 20%;
    z-index: 4;
}

.fin {
    position: absolute;
    bottom: 0;
    width: 20px;
    height: 30px;
    background-color: #718096;
    z-index: 2;
}

.fin.left {
    left: -20px;
    border-radius: 0 0 0 10px;
    transform: skewY(-30deg);
}

.fin.right {
    right: -20px;
    border-radius: 0 0 10px 0;
    transform: skewY(30deg);
}

.window {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    top: 30px;
    left: 20px;
    z-index: 4;
    box-shadow: 0 0 10px rgba(100, 255, 218, 0.5);
}

.rocket-name {
    position: absolute;
    bottom: 50px;
    left: 0;
    width: 60px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 10px;
    font-weight: bold;
    transform: rotate(-90deg);
    transform-origin: left bottom;
    z-index: 5;
}

/* Enhanced exhaust styling */
.exhaust-container {
    position: absolute;
    bottom: -20px;
    left: 10px;
    width: 40px;
    height: 60px;
    z-index: 1;
    overflow: hidden;
}

.exhaust {
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 40px;
    height: 20px;
    background: linear-gradient(to right, #ff9d00, #ff5500);
    border-radius: 50% 50% 20% 20%;
    animation: exhaust-pulse 0.2s infinite alternate;
    box-shadow: 0 0 15px rgba(255, 157, 0, 0.6);
}

@keyframes exhaust-pulse {
    0% { 
        height: 20px; 
        background: linear-gradient(to right, #ff9d00, #ff5500); 
        box-shadow: 0 0 15px rgba(255, 157, 0, 0.6);
    }
    100% { 
        height: 50px; 
        background: linear-gradient(to right, #ffd700, #ff8c00); 
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
    }
}

.exhaust::before, .exhaust::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 50px;
    background: linear-gradient(to bottom, rgba(255, 157, 0, 0.9), transparent);
    bottom: -40px;
    border-radius: 30%;
    filter: blur(3px);
}

.particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background-color: rgba(255, 215, 0, 0.8);
    border-radius: 50%;
    bottom: -20px;
    opacity: 0.9;
    box-shadow: 0 0 8px rgba(255, 157, 0, 0.8);
    filter: blur(1px);
    transition: opacity 0.05s linear;
}

/* Stars in background */
.star {
    position: fixed;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    animation: pulse 3s infinite alternate;
    z-index: 1;
    pointer-events: none;
}

@keyframes pulse {
    0% {
        opacity: 0.2;
    }
    100% {
        opacity: 0.8;
    }
}

/* Future trajectory styling */
.future-trajectory {
    position: absolute;
    top: 50%;
    right: 0;
    width: 20%;
    height: 4px;
    background: linear-gradient(90deg, 
        rgba(142, 68, 173, 0.15), 
        rgba(142, 68, 173, 0.1) 40%, 
        rgba(142, 68, 173, 0.05) 70%,
        rgba(142, 68, 173, 0.01) 100%);
    transform: translateY(-50%);
    z-index: 1;
}

/* Media queries for responsive layout */
@media (max-width: 1200px) {
    .timeline-container {
        padding: 3rem 2rem;
    }
}

/* Vertical timeline layout starts at 992px */
@media (max-width: 992px) {
    .journey-section {
        padding: 4rem 0;
    }
    
    .timeline-container {
        flex-direction: column;
        padding: 6rem 1rem 2rem 1rem;
        min-height: 1200px;
    }
    
    /* Vertical timeline line */
    .timeline-path {
        position: absolute;
        left: 50%;
        top: 120px;
        bottom: 40px;
        width: 4px;
        height: auto;
        transform: translateX(-50%);
    }
    
    /* Position rocket on the timeline - centered horizontally */
    .rocket-container.left-positioned {
        position: absolute;
        top: 280px; /* Default vertical position */
        left: 50% !important; /* Center horizontally */
        transform: translateX(-50%) !important; /* Ensure perfect centering */
        z-index: 10;
        width: 60px; /* Make rocket narrower */
        height: 100px;
    }
    
    /* Position milestones on timeline */
    .timeline-milestone {
        position: absolute;
        width: 100%;
        left: 0 !important;
        right: 0 !important;
        transform: none;
    }
    
    .first-milestone, .second-milestone, .third-milestone, .fourth-milestone {
        left: 0 !important;
        right: 0 !important;
        top: auto;
        transform: none;
    }
    
    .first-milestone {
        top: 180px;
    }
    
    .second-milestone {
        top: 480px;
    }
    
    .third-milestone {
        top: 780px;
    }
    
    .fourth-milestone {
        top: 1080px;
    }
    
    .milestone-dot {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        width: 24px;
        height: 24px;
        cursor: pointer;
        z-index: 5;
    }
    
    /* Position content to the right of the timeline */
    .first-milestone .milestone-content,
    .third-milestone .milestone-content {
        left: calc(50% + 20px);
        right: auto;
        top: -15px;
        width: calc(50% - 30px);
        max-width: 300px;
    }
    
    /* Position content to the left of the timeline */
    .second-milestone .milestone-content,
    .fourth-milestone .milestone-content {
        right: calc(50% + 20px);
        left: auto;
        top: -15px;
        width: calc(50% - 30px);
        max-width: 300px;
    }
    
    /* Adjust arrows for vertical timeline */
    .first-milestone .milestone-content::after,
    .third-milestone .milestone-content::after {
        right: 100%;
        top: 15px;
        border-right-color: rgba(0, 255, 178, 0.2);
        border-left: none;
        border-top-color: transparent;
        border-bottom-color: transparent;
    }
    
    .second-milestone .milestone-content::after,
    .fourth-milestone .milestone-content::after {
        left: 100%;
        top: 15px;
        border-left-color: rgba(0, 255, 178, 0.2);
        border-right: none;
        border-top-color: transparent;
        border-bottom-color: transparent;
    }
    
    .future-trajectory {
        display: none;
    }
    
    /* Make milestone content more prominent */
    .milestone-content {
        background-color: rgba(18, 18, 24, 0.95);
        border: 1px solid rgba(0, 255, 178, 0.5);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    }
    
    /* Make sure revealed milestone contents appear correctly */
    .milestone-content.revealed {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
        z-index: 100;
    }
}

/* Update the existing media query for 992px to 767px to move rocket down by 20px */
@media (max-width: 992px) and (min-width: 767px) {
    .rocket-container.left-positioned {
        /* Move down from the top to avoid overlapping launch checkpoint */
        top: 330px; /* Modified from 310px to move down by 20px */
        /* Center over the timeline */
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    
    .rocket-container.left-positioned .rocket {
        /* Adjust rotation for vertical timeline */
        transform: translate(-50%, -50%) rotate(180deg) !important;
    }
}

/* Remove the old 991px breakpoint since it's now handled above */
/* Additional intermediate breakpoint for smoother transitions */
@media (max-width: 850px) {
    .first-milestone .milestone-content,
    .second-milestone .milestone-content,
    .third-milestone .milestone-content,
    .fourth-milestone .milestone-content {
        width: calc(45% - 20px);
    }
}

/* Additional breakpoint for extra small screens */
@media (max-width: 575px) {
    .timeline-container {
        min-height: 1200px;
        padding: 6rem 0.5rem 2rem 0.5rem;
    }
    
    /* Consistent styling for all milestone content boxes */
    .first-milestone .milestone-content,
    .second-milestone .milestone-content,
    .third-milestone .milestone-content,
    .fourth-milestone .milestone-content,
    .milestone-content.launch-milestone,
    .milestone-content.nightfall-milestone,
    .milestone-content.projectx-milestone {
        width: 280px !important;
        max-width: 280px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        padding: 1.2rem !important;
        min-height: auto !important;
    }
    
    /* Special positioning for Launch milestone */
    .first-milestone .milestone-content,
    .first-milestone .milestone-content.launch-milestone {
        top: -120px !important; /* Position above the dot */
        bottom: auto !important;
    }

    /* Position other milestones below their dots */
    .second-milestone .milestone-content,
    .third-milestone .milestone-content,
    .fourth-milestone .milestone-content {
        top: 30px !important;
        bottom: auto !important;
    }

    /* Ensure consistent revealed state */
    .milestone-content.revealed,
    .launch-milestone.revealed,
    .nightfall-milestone.revealed,
    .enigma-milestone.revealed,
    .projectx-milestone.revealed {
        transform: translateX(-50%) translateY(0) !important;
        width: 280px !important;
        max-width: 280px !important;
        z-index: 100 !important;
    }

    /* Special handling for launch milestone when revealed */
    .first-milestone .milestone-content.revealed,
    .first-milestone .milestone-content.launch-milestone.revealed {
        top: -120px !important;
        transform: translateX(-50%) translateY(0) !important;
    }

    /* Adjust arrow direction for launch milestone */
    .first-milestone .milestone-content::after,
    .first-milestone .milestone-content.launch-milestone::after {
        top: auto !important;
        bottom: -10px !important;
        transform: translateX(-50%) rotate(45deg) !important;
        border-top-color: transparent !important;
        border-left-color: transparent !important;
    }

    /* Keep other arrows pointing up from their dots */
    .second-milestone .milestone-content::after,
    .third-milestone .milestone-content::after,
    .fourth-milestone .milestone-content::after {
        top: -10px !important;
        bottom: auto !important;
        transform: translateX(-50%) rotate(225deg) !important;
    }
    
    /* Consistent text sizes and spacing for all milestones */
    .milestone-date,
    .launch-milestone .milestone-date,
    .nightfall-milestone .milestone-date,
    .enigma-milestone .milestone-date,
    .projectx-milestone .milestone-date {
        font-size: 0.95rem !important;
        margin-bottom: 0.4rem !important;
        line-height: 1.2 !important;
    }
    
    .milestone-title,
    .launch-milestone .milestone-title,
    .nightfall-milestone .milestone-title,
    .enigma-milestone .milestone-title,
    .projectx-milestone .milestone-title {
        font-size: 1.1rem !important;
        margin-bottom: 0.4rem !important;
        line-height: 1.3 !important;
    }
    
    .milestone-text,
    .launch-milestone .milestone-text,
    .nightfall-milestone .milestone-text,
    .enigma-milestone .milestone-text,
    .projectx-milestone .milestone-text {
        font-size: 0.95rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Position milestones */
    .first-milestone {
        top: 150px;
    }
    
    .second-milestone {
        top: 450px;
    }
    
    .third-milestone {
        top: 750px;
    }
    
    .fourth-milestone {
        top: 1050px;
    }
    
    /* Ensure close button is consistently positioned and styled */
    .milestone-content .close-btn {
        position: absolute !important;
        top: 8px !important;
        right: 8px !important;
        width: 24px !important;
        height: 24px !important;
        font-size: 18px !important;
        z-index: 101 !important;
        background: rgba(0, 0, 0, 0.2) !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* Project Enigma specific styling */
.enigma-milestone {
    border-left: 4px solid #3498db;
    position: relative;
    overflow: hidden;
}

.enigma-milestone::before {
    display: none; /* Hide the glow effect */
}

.enigma-milestone:hover {
    border-color: #3498db;
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.2);
}

.enigma-milestone .milestone-date {
    color: #85c1e9;
}

.enigma-milestone .milestone-title {
    color: #fff;
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

/* Project X specific styling */
.projectx-milestone {
    border-left: 4px solid #e74c3c;
    position: relative;
    overflow: hidden;
}

.projectx-milestone::before {
    display: none; /* Hide the glow effect */
}

.projectx-milestone:hover {
    border-color: #e74c3c;
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.2);
}

.projectx-milestone .milestone-date {
    color: #f1948a;
}

.projectx-milestone .milestone-title {
    color: #fff;
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

/* Static stars - more efficient, no animations */
.static-star {
    position: fixed;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 1;
    pointer-events: none;
}

/* Twinkling stars - only a few with animations for effect */
.twinkling-star {
    position: fixed;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 1;
    transition: opacity 0.5s ease, box-shadow 0.5s ease;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.7), 0 0 10px rgba(100, 255, 218, 0.5);
    pointer-events: none;
}

.launch-milestone {
    border-left: 4px solid #64ffda;
    padding-bottom: 2.5rem; /* Add more bottom padding */
}

.launch-milestone:hover {
    border-color: #64ffda;
    box-shadow: 0 10px 30px rgba(100, 255, 218, 0.2);
}

.nightfall-milestone {
    border-left: 4px solid #8e44ad;
    position: relative;
    overflow: hidden;
}

/* Remove ::after from here if it exists, as we're using .first-milestone .milestone-content::after */
.nightfall-milestone::before {
    display: none; /* Hide the glow effect */
}

/* Force all milestone content above the dots - positioned at end to override all other styles */
.first-milestone .milestone-content,
.second-milestone .milestone-content,
.third-milestone .milestone-content,
.fourth-milestone .milestone-content {
    bottom: 40px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
}

/* When revealed, all milestone content transforms consistently */
.milestone-content.revealed {
    z-index: 999 !important;
    position: absolute !important;
    opacity: 1 !important;
    transform: translateX(-50%) translateY(0) !important;
    visibility: visible !important;
    pointer-events: all;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5) !important;
}

/* 
 * IMPORTANT: Final override styles to ensure all milestone content boxes behave correctly
 * Position these at the end to override any other styles
 */
.first-milestone .milestone-content,
.second-milestone .milestone-content,
.third-milestone .milestone-content,
.fourth-milestone .milestone-content {
    bottom: 40px !important;
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(-20px) !important;
}

.milestone-content.revealed {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(0) !important;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease !important;
}

/* Position first and third milestone content above the timeline */
.first-milestone .milestone-content,
.third-milestone .milestone-content {
    position: absolute;
    bottom: 40px; /* Position above the dot */
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
}

/* Position second and fourth milestone content below the timeline */
.second-milestone .milestone-content,
.fourth-milestone .milestone-content {
    position: absolute;
    top: 40px; /* Position below the dot */
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    /* Ensure content is fully visible by overriding any conflicting styles */
    max-height: none;
    overflow: visible;
    z-index: 15; /* Higher z-index to ensure visibility */
}

/* Additional padding to ensure the full content is visible */
.second-milestone .milestone-content,
.fourth-milestone .milestone-content {
    padding-bottom: 2rem;
}

/* Ensure the milestone content boxes have enough vertical space */
.journey-section {
    padding-bottom: 12rem;
    overflow: visible;
}

/* Update the media query for 767px and below to adjust rocket position */
@media (max-width: 767px) {
    .rocket-container.left-positioned {
        top: calc(280px + 30px); /* Original 280px + 30px down */
        left: calc(50% - 1px) !important; /* Center - 1px to move left */
        transform: translateX(-50%) !important;
    }
    
    .rocket-container.left-positioned .rocket {
        transform: translate(-50%, -50%) rotate(180deg) !important; /* 180° rotation to face downward */
    }
}

/* Arrow styling for first and third milestone content (pointing down) */
.first-milestone .milestone-content::after,
.third-milestone .milestone-content::after {
    content: '';
    position: absolute;
    bottom: -10px; /* Arrow at bottom pointing down */
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 20px;
    height: 20px;
    background-color: rgba(18, 18, 18, 0.8);
    z-index: -1;
    border-right: 1px solid rgba(100, 255, 218, 0.2);
    border-bottom: 1px solid rgba(100, 255, 218, 0.2);
}

/* Arrow styling for second and fourth milestone content (pointing up) */
.second-milestone .milestone-content::after,
.fourth-milestone .milestone-content::after {
    content: '';
    position: absolute;
    top: -10px; /* Arrow at top pointing up */
    left: 50%;
    transform: translateX(-50%) rotate(225deg); /* Rotate to point upward */
    width: 20px;
    height: 20px;
    background-color: rgba(18, 18, 18, 0.8);
    z-index: -1;
    border-right: 1px solid rgba(100, 255, 218, 0.2);
    border-bottom: 1px solid rgba(100, 255, 218, 0.2);
}

/* When revealed, adjust transform for content above the timeline */
.first-milestone .milestone-content.revealed,
.third-milestone .milestone-content.revealed {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

/* When revealed, adjust transform for content below the timeline */
.second-milestone .milestone-content.revealed,
.fourth-milestone .milestone-content.revealed {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    display: block;
    min-height: 150px; /* Ensure enough space for content */
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 20; /* Even higher z-index when revealed */
}

/* Additional intermediate breakpoint for smoother transitions */
@media (max-width: 850px) and (min-width: 768px) {
    .first-milestone .milestone-content,
    .second-milestone .milestone-content,
    .third-milestone .milestone-content,
    .fourth-milestone .milestone-content {
        width: 200px;
    }
}

/* Extra small screens */
@media (max-width: 575px) {
    .timeline-container {
        min-height: 1200px;
        padding: 6rem 0.5rem 2rem 0.5rem;
    }
    
    /* Consistent styling for all milestone content boxes */
    .first-milestone .milestone-content,
    .second-milestone .milestone-content,
    .third-milestone .milestone-content,
    .fourth-milestone .milestone-content,
    .milestone-content.launch-milestone,
    .milestone-content.nightfall-milestone,
    .milestone-content.projectx-milestone {
        width: 280px !important;
        max-width: 280px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        padding: 1.2rem !important;
        min-height: auto !important;
    }
    
    /* Special positioning for Launch milestone */
    .first-milestone .milestone-content,
    .first-milestone .milestone-content.launch-milestone {
        top: -120px !important; /* Position above the dot */
        bottom: auto !important;
    }

    /* Position other milestones below their dots */
    .second-milestone .milestone-content,
    .third-milestone .milestone-content,
    .fourth-milestone .milestone-content {
        top: 30px !important;
        bottom: auto !important;
    }

    /* Ensure consistent revealed state */
    .milestone-content.revealed,
    .launch-milestone.revealed,
    .nightfall-milestone.revealed,
    .enigma-milestone.revealed,
    .projectx-milestone.revealed {
        transform: translateX(-50%) translateY(0) !important;
        width: 280px !important;
        max-width: 280px !important;
        z-index: 100 !important;
    }

    /* Special handling for launch milestone when revealed */
    .first-milestone .milestone-content.revealed,
    .first-milestone .milestone-content.launch-milestone.revealed {
        top: -120px !important;
        transform: translateX(-50%) translateY(0) !important;
    }

    /* Adjust arrow direction for launch milestone */
    .first-milestone .milestone-content::after,
    .first-milestone .milestone-content.launch-milestone::after {
        top: auto !important;
        bottom: -10px !important;
        transform: translateX(-50%) rotate(45deg) !important;
        border-top-color: transparent !important;
        border-left-color: transparent !important;
    }

    /* Keep other arrows pointing up from their dots */
    .second-milestone .milestone-content::after,
    .third-milestone .milestone-content::after,
    .fourth-milestone .milestone-content::after {
        top: -10px !important;
        bottom: auto !important;
        transform: translateX(-50%) rotate(225deg) !important;
    }
    
    /* Consistent text sizes and spacing for all milestones */
    .milestone-date,
    .launch-milestone .milestone-date,
    .nightfall-milestone .milestone-date,
    .enigma-milestone .milestone-date,
    .projectx-milestone .milestone-date {
        font-size: 0.95rem !important;
        margin-bottom: 0.4rem !important;
        line-height: 1.2 !important;
    }
    
    .milestone-title,
    .launch-milestone .milestone-title,
    .nightfall-milestone .milestone-title,
    .enigma-milestone .milestone-title,
    .projectx-milestone .milestone-title {
        font-size: 1.1rem !important;
        margin-bottom: 0.4rem !important;
        line-height: 1.3 !important;
    }
    
    .milestone-text,
    .launch-milestone .milestone-text,
    .nightfall-milestone .milestone-text,
    .enigma-milestone .milestone-text,
    .projectx-milestone .milestone-text {
        font-size: 0.95rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Position milestones */
    .first-milestone {
        top: 150px;
    }
    
    .second-milestone {
        top: 450px;
    }
    
    .third-milestone {
        top: 750px;
    }
    
    .fourth-milestone {
        top: 1050px;
    }
    
    /* Ensure close button is consistently positioned and styled */
    .milestone-content .close-btn {
        position: absolute !important;
        top: 8px !important;
        right: 8px !important;
        width: 24px !important;
        height: 24px !important;
        font-size: 18px !important;
        z-index: 101 !important;
        background: rgba(0, 0, 0, 0.2) !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* Add a container for stars to limit their scope */
.stars-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Infinity Symbol at the end of the timeline */
.infinity-symbol {
    position: absolute;
    font-size: 2.5rem;
    color: rgba(100, 255, 218, 0.9);
    text-shadow: 0 0 15px rgba(100, 255, 218, 0.7), 0 0 30px rgba(100, 255, 218, 0.4);
    animation: glow 2s infinite alternate;
    z-index: 5;
}

/* Desktop positioning (right end of timeline) */
@media (min-width: 992px) {
    .infinity-symbol {
        top: 50%;
        right: 2%; /* Moved further right to be at the very end */
        transform: translateY(-50%);
    }
    
    /* Extend the timeline path to reach the infinity symbol */
    .timeline-path {
        right: 2%; /* Match the infinity symbol position */
    }
}

/* Mobile positioning (bottom of timeline) */
@media (max-width: 991px) {
    .infinity-symbol {
        bottom: 20px; /* Moved further down */
        left: 50%;
        transform: translateX(-50%);
    }
    
    /* Extend the vertical timeline to reach the infinity symbol */
    .timeline-path {
        bottom: 20px; /* Match the infinity symbol position */
    }
}

/* Glow animation for infinity symbol */
@keyframes glow {
    0% {
        text-shadow: 0 0 15px rgba(100, 255, 218, 0.7), 0 0 30px rgba(100, 255, 218, 0.4);
        opacity: 0.8;
    }
    100% {
        text-shadow: 0 0 20px rgba(100, 255, 218, 0.9), 0 0 40px rgba(100, 255, 218, 0.6);
        opacity: 1;
    }
}

/* Add a new media query specifically for screens between 767px and 576px */
@media (max-width: 767px) and (min-width: 576px) {
    .rocket-container.left-positioned {
        top: calc(280px + 60px); /* Original 280px + 60px down (increased by 30px) */
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    
    .rocket-container.left-positioned .rocket {
        transform: translate(-50%, -50%) rotate(180deg) !important;
    }
} 