/* General Body Styles (Optional, for full-page demo) */

/* ========== financial-planning ========== */
.timeline-section {
    padding: 40px 0;
    /* Increased padding for better vertical spacing */
    background-color: #000;
    /* Dark background as per your image */
    color: #fff;
    font-family: sans-serif;
    overflow: hidden;
    /* Important for animation bounds */
    
}

.timeline-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    /* To stack the two rows and connector */
    align-items: center;
    /* Center the timeline rows */
}

.timeline-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    width: 100%;
    /* Ensure rows span full width of container */
    padding: 25px 0;
    /* Add padding for labels */
}

.timeline-line {
    position: absolute;
    top: 50%;
    /* Center vertically */
    left: 0;
    right: 0;
    height: 4px;
    /* Thickness of the line */
    background-color: #444;
    /* Inactive line color */
    transform: translateY(-50%);
    z-index: 1;
    /* Ensure line is behind dots */

    /* For loading animation: Uses CSS custom property controlled by JS */
    background: linear-gradient(to right, #C5FD72 var(--progress, 0%), #444 var(--progress, 0%));
    background-size: 100% 100%;
    /* Ensure gradient covers full area */
    background-repeat: no-repeat;
}

.timeline-step {
    position: relative;
    z-index: 2;
    /* Ensure dots are above the line */
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-basis: 25%;
    /* Divide space evenly for 4 steps in a row */
    text-align: center;
    padding: 0 10px;
    /* Spacing between steps */
}

/* --- Revised Timeline Dot Styles (Numbered Circles with Icon) --- */
.timeline-dot {
    width: 32px;
    /* Size of the circle */
    height: 32px;
    border-radius: 50%;
    border: 2px solid #666;
    /* Inactive border color */
    position: relative;
    /* For absolute positioning of number/icon */
    display: flex;
    /* To center content */
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* Hide parts of number/icon during flip */
    perspective: 1000px;
    /* For 3D flip effect */
    margin-bottom: 12px;
    /* Adjust spacing for labels */
    background-color: #000;
    /* IMPORTANT: This matches the section background to hide the line underneath */
    z-index: 3;
    /* Ensure it's above the line */
    transition: border-color 0.3s ease, background-color 0.3s ease;
    /* Add transition for smooth hover */
}

.timeline-dot:hover {
    color: #000;

}

.timeline-dot .dot-number,
.timeline-dot .dot-icon {
    position: absolute;
    backface-visibility: hidden;
    /* Prevent backside from showing during flip */
    transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
    /* Smooth transition */
    color: #bbb;
    /* Inactive color for both */
    font-size: 16px;
    font-weight: bold;
}

.dot-number:hover {
    color: #000
}

.dot-icon:hover {
    color: #000;
}

.timeline-dot .dot-number {
    transform: rotateY(0deg);
    /* Initial state: number visible */
    opacity: 1;
}

.timeline-dot .dot-icon {
    transform: rotateY(180deg);
    /* Initial state: icon flipped and hidden */
    opacity: 0;
    font-size: 20px;
    /* Make icon slightly larger */
}


/* Active Step Class (applied to .timeline-step) */
.timeline-step.active-step .timeline-dot {
    border-color: #C5FD72;
    /* Hot pink/red border for active, like the example */
    animation: pulse 1.5s infinite alternate;
    /* Pulsing animation */
}

.timeline-step.active-step .timeline-dot .dot-number {
    color: #C5FD72;
    /* Active number color */

    /* No flip yet, as it's active but not necessarily completed */
}

.timeline-step.active-step .timeline-dot .dot-icon {
    color: #C5FD72;
    /* Active icon color */
}

.timeline-step.active-step .timeline-label {
    color: #C5FD72;
    /* Bright green for active label */
    font-weight: bold;
}

/* Completed Step Class (applied to .timeline-step) */
.timeline-step.completed-step .timeline-dot {
    border-color: #C5FD72;
    /* Bright green for completed border */
    animation: none;
    /* No pulse once completed */
}

.timeline-step.completed-step .timeline-dot .dot-number {
    transform: rotateY(-180deg);
    /* Flip number out */
    opacity: 0;
}

.timeline-step.completed-step .timeline-dot .dot-icon {
    transform: rotateY(0deg);
    /* Flip icon in */
    opacity: 1;
    color: #C5FD72;
    /* Bright green for completed icon */
}

.timeline-step.completed-step .timeline-label {
    color: #C5FD72;
    /* Bright green for completed label */
}


/* Popup messages (adjust as needed) */
.popup-message,
.popup-message2 {
    position: absolute;
    background-color: #666;
    /* Example pink background from first image */
    color: #fff;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 12px;
    white-space: normal;
    /* Allow text to wrap within popup */
    width: 150px;
    /* Fixed width for popups */
    opacity: 0;
    /* Hidden by default */
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10;
    transform: translateX(-50%);
    /* Center horizontally relative to parent label */
    left: 50%;
    pointer-events: none;
    /* Allows clicks/hovers to pass through to underlying elements if not hovered over directly */
}

.timeline-top-label .popup-message {
    bottom: calc(100% + 5px);
    /* Position above the label, adjust 5px as needed */
}

.timeline-bottom-label .popup-message2 {
    top: calc(100% + 5px);
    /* Position below the label, adjust 5px as needed */
}

/* Show popup on hover over the label */
.timeline-label:hover .popup-message,
.timeline-label:hover .popup-message2 {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    /* Make popup clickable/hoverable when visible */
}


/* --- REMOVED Timeline Connector (Vertical line) --- */
/* The entire .timeline-connector block and its @keyframes are removed */
/* You might want to adjust the margin-top/margin-bottom on .timeline-row
   or .timeline-container to control vertical spacing between rows. */
/* For instance, you could add a margin-bottom to timeline-row#timeline-row-1 */
#timeline-row-1 {
    margin-bottom: 0px;
    /* Example: add some space below the first row */
}

/* Optional: Pulse animation for current dot */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0px rgba(0, 255, 0, 0.7);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 15px rgba(0, 255, 0, 0.7);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0px rgba(0, 255, 0, 0.7);
    }
}



.custom-col-middle {
    /* This div contains both the tabs and the content below it */
    /* No direct flexbox here, as the tabs are above content */
}

.custom-tabs-container {
    display: flex;
    /* Tabs are horizontal */
    justify-content: space-evenly   ;
    /* Center the tabs */
    margin-bottom: 30px;
    /* Space between tabs and content */
    border-bottom: 2px solid #333;
    /* Separator for tabs */
}

.custom-tab {
    padding: 15px 20px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    color: #bbb;
    transition: color 0.3s ease, border-bottom 0.3s ease;
    border-bottom: 2px solid transparent;
    /* For hover/active effect */
    text-align: center;
    /* Center tab text */
}

.custom-tab:hover {
    color: #fff;
}

.custom-tab.active {
    color: #C5FD72;
    /* Green highlight for active tab */
    border-bottom: 2px solid #4CAF50;
    /* Green line under active tab */
}

/* NEW: Container for the image and text content */
.content-area-split {
    display: flex;
    /* Use flexbox to split image and text */
    gap: 40px;
    /* Space between image and text */
    align-items: flex-start;
    /* Align items to the top */
    padding: 20px 0;
    /* Padding around the content area */
}

/* Left column for the image */
.middle-image-container {
    flex: 0 0 400px;
    /* Fixed width for image container */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
    /* Adjust height as needed */
    perspective: 1000px;
    /* For 3D flip effect */
    border-radius: 8px;
    /* Optional: Rounded corners for image container */
    overflow: hidden;
    /* Ensure image doesn't overflow during flip */
}

.middle-image-container img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    border-radius: 8px;
    /* Optional: Rounded corners for the image itself */
    transition: transform 0.6s;
    /* Smooth transition for flip */
    transform-style: preserve-3d;
    /* Required for 3D transform */
    backface-visibility: hidden;
    /* Hide back of the image during flip */
}

/* Flip animation class */
.middle-image-container img.flipped {
    transform: rotateY(180deg);
}

/* Right column for the content (original custom-tab-contents) */
.custom-tab-contents {
    flex: 1;
    /* Takes remaining space */
}

.custom-tab-contents p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.custom-tab-contents p strong {
    color: #C5FD72;
    /* Highlight strong text */
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .content-area-split {
        flex-direction: column;
        /* Stack image and text vertically on smaller screens */
        align-items: center;
        /* Center items when stacked */
    }

    .middle-image-container {
        width: 100%;
        /* Image container takes full width */
        height: 250px;
        /* Adjust height for smaller screens */
        margin-bottom: 20px;
        /* Space below image */
    }

    .custom-tab-contents {
        width: 100%;
        /* Content takes full width */
    }
}

/* General mobile condensed timeline styles */
.mobile-condensed-timeline-section {
    padding: 15px 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Modern font */
    color: #333;
    background-color: #000000; /* Light background */
}

.mobile-condensed-wrapper {
    position: relative;
    padding-left: 22px; /* Space for the line and dots */
}

/* Vertical timeline line */
.mobile-condensed-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15px;
    width: 2px;
    height: 100%;
    background-color: #e0e0e0;
    z-index: 0;
}

/* Individual timeline event */
.mobile-condensed-event {
    position: relative;
    margin-bottom: 20px; /* Reduced margin */
    display: flex; /* Use flexbox for alignment */
    align-items: flex-start; /* Align dot and content at the top */
    /* Initial state for hidden elements */
    opacity: 0;
    transform: translateX(-20px); /* Start slightly left */
    transition: opacity 0.5s ease-out, transform 0.5s ease-out, box-shadow 0.3s ease;
}

/* When event enters view */
.mobile-condensed-event.event-visible {
    opacity: 1;
    transform: translateX(0); /* Slide into place */
}

/* Optional: When event leaves view (scrolling away) */
.mobile-condensed-event.event-hidden {
    opacity: 0;
    transform: translateX(20px); /* Slide out to the right */
}

/* Dot on the timeline line */
.mobile-condensed-dot {
    flex-shrink: 0; /* Prevent shrinking */
    position: absolute; /* Absolute positioning relative to event */
    left: -20px; /* Adjust to align with the vertical line */
    top: 0;
    width: 28px; /* Slightly larger dot for numbers */
    height: 28px;
    background-color: #fff;
    border: 2px solid #6c757d; /* Muted grey for inactive */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #6c757d; /* Muted grey text */
    z-index: 1;
    box-shadow: 0 0 0 4px #f8f8f8; /* Background color ring */
    transition: all 0.3s ease; /* Smooth transition for active state */
}

.mobile-condensed-event.event-visible .mobile-condensed-dot {
    border-color: #C5FD72; /* Vibrant green when active */
    color: #000000; /* Vibrant green text */
    transform: scale(1.1); /* Pop a bit */
    margin-top: 20px;
}

.mobile-condensed-dot span {
    font-size: 13px;
}

/* Styling for the "Goal" dot */
.mobile-condensed-goal .mobile-condensed-dot {
    background-color: #C5FD72; /* Solid green for goal */
    color: #fff; /* White text for contrast */
    border: 2px solid #000000; /* Match border to background */
    width: 45px; /* Larger */
    height: 45px;
    left: -27px; /* Adjust position */
}

.mobile-condensed-goal .mobile-condensed-dot span {
    font-size: 15px;
}

/* Content of the timeline event */
.mobile-condensed-content {
    background-color: #fff;
    border-radius: 10px;
    padding: 12px 15px; /* Reduced padding */
    box-shadow: 0 4px 10px rgba(0,0,0,0.08); /* Softer shadow */
    margin-left: 25px; /* Offset content from the line */
    flex-grow: 1; /* Allow content to take available space */
    transition: box-shadow 0.3s ease;
}

.mobile-condensed-event.event-visible .mobile-condensed-content {
    box-shadow: 0 6px 15px rgba(0,0,0,0.15); /* More prominent shadow when active */
}

.mobile-condensed-title {
    margin-top: 0;
    margin-bottom: 5px; /* Reduced margin */
    color: #333;
    font-size: 1em; /* Smaller title */
}

.mobile-condensed-desc {
    margin-bottom: 0;
    font-size: 0.8em; /* Smaller description text */
    line-height: 1.4;
    color: #555;
}

/* Add a class for the initial state before any scrolling happens */
/* This ensures items are hidden until observed */
.mobile-condensed-event:not(.event-visible) {
    opacity: 0;
    transform: translateX(-20px);
}



/* --- Base Styles (Desktop First - Default styles for larger screens) --- */

/* Universal Box Sizing - Highly Recommended */


/* --- Media Queries for Responsiveness with !important --- */

/* Larger Tablets & Small Laptops (max-width: 1199px) */
@media (max-width: 1199px) {

   
   
    .timeline-container {
        padding: 0 20px !important; /* Reduce horizontal padding */
    }

    .section-title .title {
        font-size: 2.5em !important;
    }

    .section-title p.mt-20 {
        font-size: 1.05em !important;
    }

    .custom-tabs-container.sub-heading {
        gap: 20px !important; /* Reduce gap */
    }

    .custom-tab {
        font-size: 1.2em !important;
        padding: 10px 20px !important;
    }

    .content-area-split {
        gap: 0px !important; /* Reduce gap between image and text */
        max-width: 900px !important;
    }

    .middle-image-container {
        min-width: 350px !important;
    }

    .custom-tab-content p {
        font-size: 1em !important;
    }
}

/* Tablets (max-width: 991px) */
@media (max-width: 991px) {
    .timeline-section {
        padding: 80px 0 !important; /* Adjust section padding */
    }

    .section-title.dsn-fill {
        margin-bottom: 50px !important;
    }

    .section-title .sub-heading {
        font-size: 1em !important;
    }

    .section-title .title {
        font-size: 2em !important; /* Smaller title */
    }

    .section-title p.mt-20 {
        font-size: 0.95em !important;
        max-width: 600px !important;
    }

    .custom-tabs-container.sub-heading {
        flex-direction: column !important; /* Stack tabs vertically */
        align-items: center !important; /* Center individual tabs */
        margin-bottom: 0px !important;
        gap: 15px !important; /* Spacing between stacked tabs */
        max-width: 100% !important; /* Allow tabs to take full width */
    }

    .custom-tab {
        font-size: 1.1em !important;
        padding: 12px 0 !important; /* More vertical padding for tap area */
        width: 80% !important; /* Make tabs wider for easier tapping */
        max-width: 400px !important; /* Limit max width of stacked tabs */
        border-bottom: none !important; /* Remove individual tab underlines */
        border-radius: 8px !important; /* Add some rounded corners to stacked tabs */
        background-color: rgba(255, 255, 255, 0.05) !important; /* Slight background for stacked tabs */
    }

    .custom-tab.active {
        border-bottom: none !important; /* No border for active stacked tab */
        /* background-color: rgba(0, 123, 255, 0.2) !important; Highlight active stacked tab */
    }

    /* Change content layout to stacked */
    .content-area-split {
        flex-direction: column !important; /* Stack image and content vertically */
        align-items: center !important; /* Center them when stacked */
        /* gap: 30px !important; Space between image and text when stacked */
        max-width: 700px !important; /* Limit overall width when stacked */
    }

    .middle-image-container {
        min-width: unset !important; /* Remove min-width restriction */
        max-width: 80% !important; /* Limit image width on tablets */
        margin-bottom: 20px !important; /* Space below image */
        flex: none !important; /* Remove flex sizing */
    }

    .custom-tab-contents {
        flex: none !important; /* Remove flex sizing */
        width: 100% !important; /* Take full width */
        min-width: unset !important; /* Remove min-width restriction */
    }

    .custom-tab-content p {
        font-size: 0.95em !important;
    }
}

/* Large Mobile Devices (max-width: 767px) */
@media (max-width: 767px) {
    .timeline-section {
        padding: 60px 0 !important;
    }

    .timeline-container {
        padding: 0 15px !important; /* Smaller horizontal padding */
    }

    .section-title.dsn-fill {
        margin-bottom: 40px !important;
    }

    .section-title .sub-heading {
        font-size: 0.9em !important;
    }

    .section-title .title {
        font-size: 1.8em !important; /* Smaller title for mobile */
    }

    .section-title p.mt-20 {
        font-size: 0.85em !important;
    }

    .custom-tabs-container.sub-heading {
        gap: 10px !important; /* Tighter gap for mobile */
    }

    .custom-tab {
        font-size: 1em !important;
        padding: 10px 0 !important;
        width: 90% !important; /* Wider tabs for easier tapping */
        max-width: 350px !important;
    }

    .middle-image-container {
        max-width: 90% !important; /* Image fills more width */
    }

    .custom-tab-content p {
        font-size: 0.9em !important; /* Smaller content text */
        margin-bottom: 15px !important;
    }
}

/* Small Mobile Devices (max-width: 575px) */
@media (max-width: 575px) {
    .timeline-section {
        padding: 40px 0 !important;
    }

    .section-title.dsn-fill {
        margin-bottom: 30px !important;
    }

    .section-title .sub-heading {
        font-size: 0.8em !important;
    }

    .section-title .title {
        font-size: 1.5em !important; /* Smallest title */
    }

    .section-title p.mt-20 {
        font-size: 0.8em !important;
    }

    .custom-tab {
        font-size: 0.9em !important;
        padding: 8px 0 !important;
        width: 95% !important; /* Nearly full width */
    }

    .middle-image-container {
        max-width: 95% !important;
    }

    .custom-tab-content p {
        font-size: 0.85em !important;
        margin-bottom: 10px !important;
    }
}

