/* Index */
body {
    font-family:"Space Grotesk", sans-serif; /* Use Inter font for better readability */
    margin: 0;
    padding: 0;
    background: #ffffff;
    width: 100; /* Full viewport width */
    height: 100; /* Full viewport height */
    overflow-y:hidden; /* Allow vertical scroll, prevent horizontal */

    /*added for arrows*/
    display: flex; /* Use flexbox for layout */
    justify-content: center;
    align-items: center;
    position: relative; /* For absolute positioning of child elements */
    /* padding-top: 35px; */
}

/*Top bar styling*/
#top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px; /* Fixed height for the bar */
  background-color: #FDC461; /* White background */
  box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Subtle shadow */
  display: flex;
  justify-content: space-between; /* Pushes items to the ends and center */
  align-items: center;
  padding: 0 20px;
  z-index: 1100; /* High z-index to stay on top */
  box-sizing: border-box; /* Ensures padding is included in the width/height */
}



/* 1. Logo Menu Button */
.logo-menu-button {
  display: block; /* Allows setting height/width */
  cursor: pointer;
}

.logo-menu-button img {
  height: 40px; /* Adjust logo size as needed */
  width: auto;
  transition: opacity 0.3s ease; /* Smooth transition for hover effect */
}

.logo-menu-button:hover img {
  opacity: 0.7; /* Makes logo transparent on hover */
}

/* 2. Title Container */
.title-container {
  display: flex; /* Make it a flex container */
  align-items: baseline; /* Align items at their text baseline */
  gap: 10px; /* Add some space between the resource title and chapter title */
  text-align: left; /* Keep overall text alignment left */
  margin: 3rem;
  color: #1A4651;
  flex-grow: 1; /* Allows the title to take up the middle space */
}

.resource-title {
  font-weight: bold;
  font-size: 1.2rem;
  white-space: nowrap; /* Prevent the resource title from wrapping */
}

.chapter-title {
  font-size: 1rem;
  color: #555;
  white-space: nowrap; /* Prevent the chapter title from wrapping */
}

/* 3. Toggle Switch Container */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 10px; /* Space between labels and the switch */
  margin: 10px;
}

.toggle-label {
  font-weight: 500;
  color: #333;
}



/* Main menu things */
  .container {
            width: 100%;
            height: auto;
            max-width: 100vw;
            margin: 0;
            padding: 5vh;
            height: 100%; /* Or min-height: 100% */
            display: flex;
            flex-direction: column;
        }
        /* Header */
        header {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            padding: 0px 0;
            margin-bottom: 0px;
        }
        /* 1. Base button for ALL buttons */
        .btn {
        /* Common properties */
            display: inline-block;
            font-family: "Inter", sans-serif;
            font-weight: bold;
            /* Use clamp() for fluid font size again */
            /* clamp(MINIMUM_SIZE, PREFERRED_SCALABLE_SIZE, MAXIMUM_SIZE) */
            font-size: clamp(1rem, 2.5vw, 1.25rem); /* Scales between 16px and 20px */    
            cursor: pointer;
            text-align: center;
            text-decoration: none;
            border-radius: 8px;
            margin: 0 10px;

        /* Default visual style */
            background-color: #f39c12;
            color: white;
            border: 2px solid #f39c12; /* Set a consistent border */
            padding: .75em 1.5em; /* Padding for button */
             }

        /* Our team button */
        .btn-primary-orange {
            background-color: #f39c12; /* Orange color from image */
            color: white;
        }
        .btn-primary-orange:hover {
            background-color: #ffffff;
            border: 2px solid #f39c12; /* Orange color from image */
            color: #f39c12;
        }
        /* Main Content Area */
        .main-content {
            display: flex;
            flex-direction: row; /* This is KEY: Arrange children (logo, content-stack) side-by-side */
            align-items: center;    /* Vertically align the logo and the content stack */
            justify-content: center;/* Center the whole two-column group on the page */
            gap: 50px;              /* Create a gap between the logo and the content stack */
            margin-top: 10vh; /* Space below the header */
            flex-grow: 1; /* Allow it to fill the vertical space */
            padding: 20px;
            height: 100%;
        }

        /* Intro text and start button */
        .content-stack {
            display: flex;
            flex-direction: column; /* Stack children (text, button) vertically */
            gap: 25px;              /* Create space between the text and the button */
            
            /* This is KEY: Aligns the text and button to the left within this column */
            align-items:center; /* Center the text and button horizontally */
        }

        /* logo */
        #Logo {
            width: 25vw; /* Adjust as needed */
            max-width: 350px; /* Limit maximum width */
            min-width: 150px;
            height: auto;
        }


        .btn-start:hover {
            background-color: #ffffff;
            border: 2px solid #f39c12; /* Orange color from image */
            color: #f39c12;
        }

        .intro-text {
            /* Use clamp() for fluid font size again */
            font-size: clamp(1rem, 2.5vw, 1.25rem); /* Scales between 16px and 20px */
            color: #1A4651;
            line-height: 1.6;
            font-weight: 500;
            max-width: 60ch; /* Use 'ch' unit to cap line-length for readability */
            text-align: center; /* Recommended for centered layouts */
            margin-bottom: 0px;
            
        }
        .main-content h4 {
            /* Use clamp() for fluid font size again */
            font-size: clamp(0.5rem, 2.5vw, 1rem); /* Scales between 16px and 20px */
            color: #1A4651;
            line-height: 1.6;
            font-weight: 500;
            max-width: 60ch; /* Use 'ch' unit to cap line-length for readability */
            text-align: center; /* Recommended for centered layouts */
            margin-bottom: 0px;
            
        }
        /* Resources */
        .resources-container {
            display: flex;
            justify-content: space-around; /* Distribute items evenly */
            align-items: flex-start;
            gap: 20px;
            width: 100%;
        }

        .resource-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            text-decoration: none;
            color: #333;
        }

        .resource-circle {
            width: 100px;
            height: 100px;
            background-color: #ddeedd; /* Light greenish color */
            border-radius: 50%;
            margin-bottom: 10px;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
        }
        .resource-item span {
            font-size: 14px;
            font-weight: 500;
        }

        /* Lightbox (Initially Hidden) */
        .mainmenu-lightbox-overlay {
            display: none; /* Hidden by default */
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent black */
            justify-content: center;
            align-items: center;
            z-index: 1000; /* Ensure it's on top */
        }

        .mainmenu-lightbox-content {
            background-color: white;
            padding: 30px;
            border-radius: 8px;
            max-width: 500px;
            width: 80%;
            box-shadow: 0 0 20px rgba(0,0,0,0.2);
            position: relative;
        }

        .mainmenu-lightbox-close {
            position: absolute;
            top: 10px;
            right: 15px;
            font-size: 24px;
            font-weight: bold;
            color: #555;
            cursor: pointer;
        }
        .mainmenu-lightbox-close:hover {
            color: #000;
        }
        

#main-menu button {
    display: inline-block;
    margin: 20px;
    padding: 40px 60px;
    background: #F49F0A;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 3rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s; /* Added transform for hover effect */
}

/*Main menu hamburger menu */
/* Container for the hamburger menu and its dropdown */
.hamburger-menu {
    position: relative; /* This is crucial for positioning the dropdown */
    display: inline-block;
}

/* Styling for the hamburger button itself */
.hamburger-btn {
    width: 40px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 0;
}

/* Styling for the three lines (spans) of the hamburger icon */
.hamburger-btn span {
    display: block;
    width: 100%;
    height: 4px;
    background-color: #333; /* Or whatever color you prefer */
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

/* --- Animation for the icon turning into an 'X' --- */
.hamburger-btn.open span:nth-child(1) {
    transform: translateY(13px) rotate(45deg);
}

.hamburger-btn.open span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.open span:nth-child(3) {
    transform: translateY(-13px) rotate(-45deg);
}


/* Styling for the dropdown menu */
.menu-dropdown {
    display: none; /* Hidden by default */
    position: absolute;
    top: calc(100% + 10px); /* Positioned below the button with 10px spacing */
    right: 0;
    background-color: white;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 8px;
    min-width: 200px;
    z-index: 3000; /* Ensures it appears on top of other content */
    overflow: hidden; /* Ensures content respects the border-radius */
}

/* Class to show the menu when active */
.menu-dropdown.active {
    display: block;
}

/* Styling for the links inside the dropdown */
.menu-dropdown .menu-item {
    display: block;
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    font-family: 'Inter', sans-serif; /* Using the font from your project */
    transition: background-color 0.2s ease;
}

/* Hover effect for the menu items */
.menu-dropdown .menu-item:hover {
    background-color: #f1f1f1;
}


 /*Not used? */
@keyframes fadeOut {
    to {
      opacity: 0;
      visibility: hidden;
    }
}
 /* Necessary */
.hidden {
    display: none !important; /* Make sure hidden class always hides */
}


/* -------------------------------------------------------------------- */
/* Chapter styles */
.chapter-container {
    position: relative;
    width: 100vw;
    min-height: 100vh; /* Use min-height to accommodate content and nav bar */
    overflow: hidden;
    padding-bottom: 80px; /* Add padding at the bottom for the fixed nav bar space */
}
 
.background-img {
    position: fixed;
    top: 4vh; /* Adjusted to account for the top bar */
    width: 100%;
    height: 100%;
    object-fit:cover;
    z-index: 0; /* Ensure it's behind content */
}
/* NEED FOR  background image and chapter changes FOR CHAPTER 2*/
/*--------------------------*/
.background-img-dynamic {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Remains the magic for proper scaling */
    z-index: 0; /* Ensures it's at the back */
}
#pages-wrapper {
    position: absolute; /* Positioned relative to chapter-container */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* It now correctly fills the chapter-container */
}
.vn-page {
    display: none; /* Hidden by default */
    position: absolute; /* Stacks these pages on top of each other */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Each page fills its parent (#pages-wrapper) */
    box-sizing: border-box;
    padding: 20px; /* Added general padding for content within each page */

    display: flex; /* Default for the JS `active-page` class */
    flex-direction: column;
    justify-content: center; /* Centers content vertically within the page */
    align-items: center; /* Centers content horizontally within the page */
    text-align: center; /* Centers text */
    
    z-index: 1; /* Ensures vn-pages are above the background image */
}

.vn-page.active-page {
    display: flex; /* Overrides `display: none` to show the active page */
}




/*--------------------------*/

/* NAVIGATION arrows */
.arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    /*sizing arrows*/
    width: 60px; /* Fixed width for the arrow */
    display: flex;
    align-items: center;
    justify-content: center;
    /* background-color: rgba(0, 0, 0, 0.5); */
    color: #C85E00;
    padding: 1rem;
    cursor: pointer;
    z-index: 4 ; /* Above background, below popups if any */
    user-select: none;
    transition: background-color 0.3s, color 0.3s; /* Added transition */
}


    .arrow:hover {
    /* opacity: 0.7; Make the icon itself translucent */
    transform: translateY(-50%) scale(1.1); /* Slightly enlarge on hover */
}


 
.arrow.left {
    left: 2rem;
}
 
.arrow.right {
    right: 2rem;
}

 
/* Textbox */
.text-box {
    position: fixed;
    bottom: 6rem; /* Adjust if it overlaps with new nav bar */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100vw - 16vw); /* Max width with padding */
    /* Max width for readability */
    background: #E1F3F4;
    border: 5px solid #457885; 
    padding:4vh;
    border-radius: 2rem;
    font-size: calc(12px + 1.2vh); /* Scalable font size */
    color: #1A4651;
    z-index: 3; /* Above background image */
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    text-align: center; /* Text content should be centered if desired */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Progress bar pages: Dots (inside text-box) */
.progress-bar {
    /* Positioning */
    position: fixed;
    bottom: 4rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 600; /* Ensures it's on top of other content */

    /* Flex layout for the dots */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;

    /* bg*/
    background: rgba(255, 255, 255, 0.8); /* Semi-transparent white background */
    padding: 8px 16px; /* Padding around the dots */
    border-radius: 20px; /* Rounded corners for the bar */
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #d8d8d8;
    transition: background-color 0.3s ease;
}

.progress-dot.active {
    background-color: #457885; /* Or match your theme */
}
 
/* Toggle switch */

/*
  This rule finds any element with the class ".toggle-container"
  that exists inside a body with the class ".page-chapter-1" OR ".page-chapter-2"
  and hides it completely.
*/
.page-chapter-1 .toggle-container,
.page-tutorial .toggle-container,
.page-chapter-2 .toggle-container {
  visibility: hidden; /* Hides the element but keeps its space */
  opacity: 0;         /* Makes it fully transparent */
}

/* Toggle switch styles */
.toggle-switch {
    position: relative;     /* CRITICAL: This allows the inner .slider to be positioned correctly within the switch */
    display: inline-block;  /* This is fine, it allows the element to have a defined width and height */
    min-width: 60px;            /* KEEP: This defines the switch's size */
    height: 34px;           /* KEEP: This defines the switch's size */
    ;
}
.toggle-switch input { display: none; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #2D643E;
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 26px; width: 26px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #45327C;
}
input:checked + .slider:before {
    transform: translateX(26px);
}
 
/* UI - Main menu button */
.menu-button {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 10px 20px;
    background-color: #FFA726;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: medium;
    cursor: pointer;
    z-index: 1000; /* Consistent z-index */
    transition: background-color 0.3s;
}
.menu-button:hover {
    background-color: #FFA726;
}

/* Main menu modal confirmation popup */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000; /* Higher than other UI elements */
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-around;
}
.modal-button {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}
.modal-button.confirm {
    background-color: #FFA726;
    color: white;
}
.modal-button.cancel {
    background-color: #ccc;
}
.modal-button:hover {
    opacity: 0.9;
}


/* END OF YOUR ORIGINAL STYLES - NEW/UPDATED NAVIGATION STYLES BELOW */
/* -------------------------------------------------------------------- */
/* MAINMENU chapter NAV background rectangle bar*/
    #chapter-nav-container-main {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: #FFD791; /* Light brownish/grey background for the bar */
        padding: 8px 0; 
        z-index: 1500; /* Above page content, below modals */
        text-align: center;

        box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
        /* border-top: 1px solid #CECABE;  */
    }
    /*---------*/
     /* Buttons in the chapter bar */
    #chapter-nav-container-main ul {
        list-style-type: none;
        margin: 0;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    #chapter-nav-container-main ul li {
        /*margin between the buttons horizontal*/
        margin: 0 5px; 
        position: relative; /* For popup positioning */
        /* ADD these flex properties to allow items to shrink and grow */
        flex-grow: 1;   /* Allow items to grow to fill empty space */
        flex-shrink: 1; /* Allow items to shrink when space is limited */
        flex-basis: 0;    /* Tell items to share space equally */
        min-width: 0;   /* CRUCIAL: Allows items to shrink below their natural text width */
    }

   
    #chapter-nav-container-main ul li a {
        display: flex; 
        align-items: center;
        justify-content: center;
        background-color: #FFF4E0; 
        color: #C85E00; 
        text-decoration: none;
        padding: 10px 8px; 
        border-radius: 25px; 
        /* border: 5px solid #C85E00;  */
        font-weight:bold; 
        letter-spacing: 0.5px;
        transition: background-color 0.25s ease-in-out, color 0.25s ease-in-out, border-color 0.25s ease-in-out; 
        white-space: normal;/* Allow text to wrap */ 
        text-align: center; /* Center text if it wraps to a new line */
        line-height: 1.2;   /* Adjust line height for wrapped text */
        width: 100%;        /* Make link fill its flexible container (the li) */
        box-sizing: border-box; /* Include its own padding/border in its width */ 
    }

    /* Hover Effect for Buttons */
    #chapter-nav-container-main ul li a:hover {
        background-color: #FDC461; 
        color: #C85E00; 
        border-color: #ffffff; 
    }

    /* Active Button Style */
    #chapter-nav-container-main ul li a.active,
    #chapter-nav-container-main ul li a.active-parent { /* Style for parent of an active sub-item */
        background-color: #C85E00; 
        color: #FFFFFF; 
        border-color: #C85E00; 
        font-weight: 700;
    }


/* ENDOSCOPIC NAV*/
    #chapter-nav-container-endo {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: #EEFADC; /*green bar */
        padding: 8px 0; 
        z-index: 150; /* Above page content, below modals */
        text-align: center;
        box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
        /* border-top: 1px solid #CECABE;  */
        
    }

    #chapter-nav-container-endo ul {
        list-style-type: none;
        margin: 0;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #chapter-nav-container-endo ul li {
        margin: 0 5px; 
        position: relative; /* For popup positioning */
        /* ADD these flex properties to allow items to shrink and grow */
        flex-grow: 1;   /* Allow items to grow to fill empty space */
        flex-shrink: 1; /* Allow items to shrink when space is limited */
        flex-basis: 0;    /* Tell items to share space equally */
        min-width: 0;   /* CRUCIAL: Allows items to shrink below their natural text width */
    }

    /* New Button Styles */
    #chapter-nav-container-endo ul li a {
        display: flex; 
        align-items: center;
        justify-content: center;
        background-color: #CBE4A7; /* Light cream/beige button background */
        color: #2D643E; 
        text-decoration: none;
        padding: 10px 8px; 
        border-radius: 25px; 
        font-weight:bold; 
        letter-spacing: 0.5px;
        transition: background-color 0.25s ease-in-out, color 0.25s ease-in-out, border-color 0.25s ease-in-out; 
        white-space: normal;/* Allow text to wrap */ 
        text-align: center; /* Center text if it wraps to a new line */
        line-height: 1.2;   /* Adjust line height for wrapped text */
        width: 100%;        /* Make link fill its flexible container (the li) */
        box-sizing: border-box; /* Include its own padding/border in its width */ 
    }

    /* Hover Effect for Buttons */
    #chapter-nav-container-endo ul li a:hover {
        background-color: #a9c384; /* Brownish tan hover */
        color: #2D643E; 
        border-color: #ffffff; 
    }

    /* Active Button Style */
    #chapter-nav-container-endo ul li a.active,
    #chapter-nav-container-endo ul li a.active-parent { /* Style for parent of an active sub-item */
        background-color: #2D643E; /* Muted brown active color */
        color: #FFFFFF; 
        border-color: #ca5405; 
        font-weight: 700;
    }

/* CRANIAL VAULT NAV */
        #chapter-nav-container-cranial {
        position: fixed;
        bottom:0;
        left: 0;
        width: 100%;
        background-color: #EEEDF7; /* Light brownish/grey background for the bar */
        padding: 8px 0; 
        z-index: 150; /* Above page content, below modals */
        text-align: center;

        box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
        /* border-top: 1px solid #CECABE;  */
    }

    #chapter-nav-container-cranial ul {
        list-style-type: none;
        margin: 0;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #chapter-nav-container-cranial ul li {
        margin: 0 5px; 
        position: relative; /* For popup positioning */
        /* ADD these flex properties to allow items to shrink and grow */
        flex-grow: 1;   /* Allow items to grow to fill empty space */
        flex-shrink: 1; /* Allow items to shrink when space is limited */
        flex-basis: 0;    /* Tell items to share space equally */
        min-width: 0;   /* CRUCIAL: Allows items to shrink below their natural text width */
    }

    /* New Button Styles */
    #chapter-nav-container-cranial ul li a {
        display: flex; 
        align-items: center;
        justify-content: center;
        background-color: #cfc6ec; /* light purple*/
        color: #45327C; 
        text-decoration: none;
        padding: 10px 8px; 
        border-radius: 25px; 
        /* border: 5px solid #45327C;  */
        font-weight:bold; 
        letter-spacing: 0.5px;
        transition: background-color 0.25s ease-in-out, color 0.25s ease-in-out, border-color 0.25s ease-in-out; 
        white-space: normal;/* Allow text to wrap */ 
        text-align: center; /* Center text if it wraps to a new line */
        line-height: 1.2;   /* Adjust line height for wrapped text */
        width: 100%;        /* Make link fill its flexible container (the li) */
        box-sizing: border-box; /* Include its own padding/border in its width */ 
    }

    /* Hover Effect for Buttons */
    #chapter-nav-container-cranial ul li a:hover {
        background-color: #b2afd0; /* Brownish tan hover */
        color: #45327C; 
        border-color: #E2F1F3; 
    }

    /* Active Button Style */
    #chapter-nav-container-cranial ul li a.active,
    #chapter-nav-container-cranial ul li a.active-parent { /* Style for parent of an active sub-item */
        background-color: #45327C; /* Muted brown active color */
        color: #ffffff; 
        border-color: #45327C; 
        font-weight: 700;
    }




/* Icon Styling (for popup arrows) */
.nav-icon.popup-icon {
    margin-left: 8px; /* Space between text and icon */
    font-size: 0.8em; /* Slightly smaller icon */
    line-height: 1;
    display: inline-block;
    transition: transform 0.2s ease-in-out;
}

/* Change icon direction when popup is open */
.has-popup.popup-open > a > .nav-icon.popup-icon {
    transform: rotate(180deg); /* Points downward when open, if initial is upward arrow */
}



/* --- Chapter NAV Popup Menu Styles --- */
.popup-menu {
    position: absolute;
    bottom: calc(100% + 5px); /* Position above the button */
    left: 50%;
    
    /* 1. Start hidden and slightly moved down */
    transform: translate(-50%, 10px); /* Start 10px down from its final position */
    opacity: 0;                       /* Start fully transparent */
    visibility: hidden;               /* Start hidden AND non-interactive */
    
    /* 2. Define the smooth transition */
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;

    /* Other styles remain the same */
    min-width: 190px; 
    background-color: #F5F3EF;
    border-radius: 6px;
    box-shadow: 0 -3px 10px rgba(0,0,0,0.15);
    z-index: 160; 
    padding: 8px;    position: absolute;
    bottom: calc(100% + 5px); /* Position above the button with a 5px gap */
    left: 50%;
    transform: translateX(-50%); 
    min-width: 190px; 
    background-color: #F5F3EF; /* Light cream/beige background */
    border-radius: 6px;
    box-shadow: 0 -3px 10px rgba(0,0,0,0.15); /* Shadow adjusted for upward menu */
    z-index: 160; 
    padding: 8px 0px;
    flex-direction: column;
    /* margin-bottom: 5px; /* Already handled by bottom calc */
}

/* This rule makes it appear on hover */
.has-popup.popup-open > .popup-menu {
    opacity: 1;     /* 3. Transition to visible state */
    transform: translate(-50%, 0); /* Move to its final position */
    opacity: 1;                     /* Make it fully visible */
    visibility: visible;            /* Make it visible and INTERACTIVE */}


/*---------------------------------------------*/
/* Popup menu list items */
.popup-menu li {
    list-style: none;  
    width: 100%;
}

.popup-menu li a {
    display: block;
    padding: 10px 18px; /* Consistent padding */
    color: #deb736; 
    background-color: transparent; 
    text-decoration: none;
    white-space: nowrap;
    border: none; 
    border-radius: 4px; /* Slightly rounded corners */
    margin-bottom: 4px; /* Space between buttons in list */
    text-align: left; 
    font-weight: normal; 
    letter-spacing: normal; /* Reset letter spacing from parent */
    min-width: auto; /* Reset min-width */
}

/* Add a rule to remove the margin from the very last button */
.popup-menu li:last-child a {
    margin-bottom: 0;
}

.popup-menu li a:hover {
    background-color: #FFA726; /* Slightly darker orange on hover */
    color: #FFFFFF; /* Ensure text remains white */
}

.popup-menu li a.active-sub-item {
    background-color: #FB8C00; /* Even darker orange for active sub-item */
    color: #FFFFFF;
    font-weight: bold;
}



/*----------------------------------------------*/







/* --- Audio --- */
.audio-button {
    display: flex; /* Use flexbox to align icon and text */
    align-items: center;
    position: absolute; /* Position it on top of the background */
    top: 40%; /* Example positioning: center vertically */
    left: 50%; /* Example positioning: center horizontally */
    transform: translate(-50%, -50%); /* Fine-tune centering */
    padding: 15px 30px 15px 15px;
    background-color: #C56200; /* An orange-brown color from your image */
    color: white;
    border: none;
    border-radius: 50px; /* Highly rounded corners */
    cursor: pointer;
    font-family: sans-serif;
    font-size: 24px;
    font-weight: bold;
    z-index: 10; /* Make sure it's above the background image */
}

.audio-button .icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    width: 3.5rem; /* Width of the circle */
    height: 3.5rem; /* Height of the circle */
    border: 3px solid white;
    border-radius: 50%; /* Makes it a circle */
    margin-right: 20px;
    flex-shrink: 0; /* Prevents shrinking */
}

.audio-button svg {
    width: 30px; /* Size of the play/pause icon */
    height: 30px;
    stroke: white; /* Color of the icon */
    fill: white; /* Fill for the play icon */
}

/* PATH SELECTION MODAL STYLING */
/* Modal Overlay */
.path-choice-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent black background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it's on top of other content */
    opacity: 0; /* Start hidden */
    visibility: hidden; /* Start invisible */
    transition: opacity 0.3s ease, visibility 0.3s ease; /* Smooth transition */
}

.path-choice-overlay.visible {
    opacity: 1; /* Fade in */
    visibility: visible; /* Make visible */
}

/* Modal Content */
.path-choice-content {
    background-color: #ffffff; /* White background for the modal */
    padding: 40px;
    border-radius: 12px; /* Rounded corners */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); /* Soft shadow */
    text-align: center;
    max-width: 500px; /* Max width for responsiveness */
    width: 90%; /* Fluid width */
    transform: translateY(-20px); /* Start slightly above center */
    transition: transform 0.3s ease, opacity 0.3s ease; /* Smooth entry animation */
    opacity: 0; /* Start hidden */
}

.path-choice-overlay.visible .path-choice-content {
    transform: translateY(0); /* Slide into place */
    opacity: 1; /* Fade in */
}

.path-choice-content h2 {
    font-family: 'Inter', sans-serif; /* Use Inter font */
    font-size: 1.8em;
    color: #2c3e50; /* Darker text for headings */
    margin-bottom: 15px;
}

.path-choice-content p {
    font-family: 'Inter', sans-serif;
    font-size: 1.1em;
    color: #34495e; /* Slightly lighter text for body */
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Button Container */
.path-choice-actions {
    display: flex;
    flex-direction: column; /* Stack buttons vertically on small screens */
    gap: 15px; /* Space between buttons */
    margin-bottom: 20px;
}

/* Buttons */
.path-choice-button {
    font-family: 'Inter', sans-serif;
    font-size: 1.1em;
    padding: 15px 25px;
    border: none;
    border-radius: 8px; /* Rounded button corners */
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease, box-shadow 0.3s ease;
    width: 100%; /* Full width within its container */
    font-weight: 600; /* Slightly bolder text */
    letter-spacing: 0.5px;
}

/* Specific styling for path selection buttons */
#navModalSelectEndoscopic {
    background-color: #2D643E; /* Blue */
    color: #ffffff;
    /* box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3); */
}
#navModalSelectCV {
    background-color: #45327C; /* Blue */
    color: #ffffff;
    /* box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3); */
}

#navModalSelectEndoscopic:hover{
    background-color: #A9C384; /* Darker blue on hover */
    transform: translateY(-2px); /* Slight lift effect */
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.4);
}
#navModalSelectCV:hover {
    background-color: #ba9bdd; /* Darker blue on hover */
    transform: translateY(-2px); /* Slight lift effect */
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.4);
}

#navModalSelectEndoscopic:active,
#navModalSelectCV:active {
    transform: translateY(0); /* Press effect */
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.3);
}

/* Styling for the Cancel button */
/* Remove existing styles that make it look like a typical button */
#navModalCancelPathChoice {
            position: absolute;
            top: 10px;
            right: 15px;
            font-size: 24px;
            font-weight: bold;
            color: #555;
            cursor: pointer;
}

#navModalCancelPathChoice:hover {
color: #000;
}

/* If you added a general close-modal-btn class, you can put common styles there */
.close-modal-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 2em; /* Example size */
    color: #333; /* Default color */
    padding: 5px; /* Small padding for easier clicking */
    transition: color 0.3s ease;
}

.close-modal-btn:hover {
    color: #007bff; /* Example hover color */
}

/* Responsive adjustments for buttons */
@media (min-width: 600px) {
    .path-choice-actions {
        flex-direction: row; /* Buttons side-by-side on larger screens */
        justify-content: center;
    }
    .path-choice-button {
        width: auto; /* Allow buttons to size naturally */
        min-width: 200px; /* Ensure a minimum width */
    }
}




/* FOR SURGERY PAGES */

.page-content-title { /* Changed class name */
  position: relative;
  top: 12vh; /* Adjust as needed */
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  text-align: center;
  font-size: 3vw; /* Adjust as needed */
  color: #333; /* Or your preferred color */
  z-index: 2; /* Ensure it's above the background image */
  font-weight: bold;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  margin-top: 2vh; /*Add some padding for better readability*/
}

.page-content-description { /* Changed class name */
  position: relative;
  top: 15vh; /* Adjust to be below the title */
  left: 50%;
  transform: translateX(-50%);
  width: 70vw;
  text-align: center;
  font-size: 2vw; /* Adjust as needed */
  color: #555; /* Or your preferred color */
  z-index: 3;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
}


/*Our team lightbox styling*/
/* --- Our Team Lightbox Styles --- */
.our-team-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent black overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it's on top of other content */
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.our-team-lightbox.hidden {
    opacity: 0;
    visibility: hidden;
}

.our-team-lightbox-content {
    background-color: #fff;
    padding: 25px; /* Reduced padding from 30px */
    border-radius: 8px;
    position: relative;
    max-width: 75%; /* Reduced max-width from 90% */
    max-height: 85%; /* Reduced max-height from 90% */
    overflow-y: auto; /* Enable scrolling for content that exceeds height */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: scale(1);
    transition: transform 0.3s ease;
}

.our-team-lightbox.hidden .our-team-lightbox-content {
    transform: scale(0.95); /* Slight scale down animation when hidden */
}

.close-btn {
    position: absolute;
    top: 10px; /* Adjusted slightly */
    right: 15px; /* Adjusted slightly */
    font-size: 1.8em; /* Reduced font size from 2em */
    cursor: pointer;
    color: #333;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: rgb(73, 73, 73); /* Red on hover for close button */
}

.our-team-lightbox-content h2 {
    font-family: 'Space Grotesk', sans-serif;
    text-align: center;
    color: #333;
    margin-bottom: 25px; /* Reduced margin */
    font-size: 2em; /* Reduced font size from 2.2em */
    letter-spacing: 1.2px; /* Slightly reduced letter spacing */
    text-transform: uppercase;
}

/* --- Team Members Layout --- */
.team-members {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* Ensures three equal-width columns */
    gap: 20px; /* Reduced gap from 30px */
    justify-content: center;
}

.team-member {
    background-color: #f9f9f9;
    padding: 15px; /* Reduced padding from 20px */
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.team-portrait {
    width: 120px; /* Reduced width from 150px */
    height: 120px; /* Reduced height from 150px */
    border-radius: 20%; /* Make them round */
    object-fit: cover; /* Ensures image covers the area without distortion */
    margin-bottom: 0; /* Reduced margin */
    border: 3px solid #FF8C00; /* Orange border, matching your button */
}

.team-member h3 {
    font-family: 'Inter', sans-serif;
    color: #555;
    margin-bottom: 8px; /* Reduced margin */
    font-size: 1.2em; /* Reduced font size from 1.4em */
}

.team-member p {
    font-family: 'Inter', sans-serif;
    color: #666;
    font-size: 0.9em; /* Reduced font size from 0.95em */
    line-height: 1.5; /* Slightly reduced line height */
    text-align: left; /* Align bio text to the left */
}

/* --- Responsive Adjustments (Keep these for general responsiveness if needed, but the core layout remains 3 columns) --- */
@media (max-width: 992px) { /* Adjusted breakpoint to make it smaller sooner */
    .our-team-lightbox-content {
        max-width: 85%; /* Adjusting max-width for slightly smaller screens */
    }
}

@media (max-width: 768px) {
    .our-team-lightbox-content {
        padding: 20px; /* Further reduction for smaller screens */
        max-width: 90%; /* Allow it to be wider on smaller screens to avoid tiny content */
    }

    .our-team-lightbox-content h2 {
        font-size: 1.6em; /* Further reduction */
        margin-bottom: 15px;
    }

    .team-members {
        /* Still 3 columns, but might need horizontal scrolling */
        gap: 15px;
    }

    .team-portrait {
        width: 100px; /* Further reduction */
        height: 100px;
    }

    .team-member h3 {
        font-size: 1.1em;
    }

    .team-member p {
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .our-team-lightbox-content {
        padding: 15px;
        max-width: 95%; /* Maximizing width for very small screens */
        max-height: 80%;
    }

    .our-team-lightbox-content h2 {
        font-size: 1.4em;
        margin-bottom: 10px;
    }

    .close-btn {
        font-size: 1.6em;
        top: 8px;
        right: 12px;
    }

    .team-portrait {
        width: 80px; /* Smallest portrait size */
        height: 80px;
    }
}



/* Tooltip Container - No changes needed here for this specific request */
.static-title-container {
    position: fixed;
    top: 280px; /* Adjust as needed for vertical positioning */
    z-index: 1000; /* Ensure it's above other content */
    text-align: center;
    background-color: #ffffff;
    border: 4px solid #e8aaaa;
    width: 20vw;
    border-radius: 10px;
}
.static-title-container h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1em; /* Adjust as needed */
    color: #333; /* Dark text color */
    margin: 0;
    padding: 10px;
    text-align: center;
    letter-spacing: 1px;
}

.static-tooltip-container {
    position: fixed;
    background-color: #e8aaaa;
    border: 4px solid #c62c2c;
    border-radius: 10px;
    padding: 1.5vw;
/* Glow Effect */
/* box-shadow: 0 0 10px 3px rgba(255, 255, 255, 0.7); Soft white glow */
/* Experiment with these values: */
    /* box-shadow: 0 0 8px 2px rgba(200, 200, 200, 0.6); Light gray glow */
    z-index: 1000;
    width: 15vw;
    max-width: 25vw;
    text-align: center;
    font-family: Arial, sans-serif;
    color: #333;
    pointer-events: auto;
    font-size: 2vh;
    font-weight: bold;
    line-height: 1.4;
    box-sizing: border-box;


    /* Define custom properties for arrow offset */
    /* These will be overridden by inline styles on individual tooltips */
    --arrow-horizontal-offset: 50%; /* Default to center */
    --arrow-vertical-offset: 50%;   /* Default to center */
}


/* Tooltip Triangle (Arrow) - UPDATED for flexible positioning */
.static-tooltip-container::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    z-index: 999;
    border-width: clamp(8px, 1vw, 15px);


    /* Remove transforms here, apply them per direction with offset */
}

/* Arrow pointing UP (tooltip is BELOW target) */
.static-tooltip-container.arrow-top::before {
    border-color: transparent transparent #c62c2c transparent;
    top: calc(-1 * (clamp(16px, 2vw, 30px) - 0.4px)); /* Added +1px */
    left: var(--arrow-horizontal-offset);
    transform: translateX(-50%);
}

/* Arrow pointing DOWN (tooltip is ABOVE target) */
.static-tooltip-container.arrow-bottom::before {
    border-color: #c62c2c transparent transparent transparent;
    bottom: calc(-1 * (clamp(16px, 2vw, 30px) - 0.5px));
    left: var(--arrow-horizontal-offset); /* Use custom property */
    transform: translateX(-50%); /* Only translateX needed */
}

/* Arrow pointing LEFT (tooltip is to the RIGHT of target) */
.static-tooltip-container.arrow-left::before {
    border-color: transparent #c62c2c transparent transparent;
    left: calc(-1 * (clamp(16px, 2vw, 30px) - 0.4px));
    top: var(--arrow-vertical-offset); /* Use custom property */
    transform: translateY(-50%); /* Only translateY needed */
}

/* Arrow pointing RIGHT (tooltip is to the LEFT of target) */
.static-tooltip-container.arrow-right::before {
    border-color: transparent transparent transparent #c62c2c;
    right:calc(-1 * (clamp(16px, 2vw, 30px) - 0.5px));
    top: var(--arrow-vertical-offset); /* Use custom property */
    transform: translateY(-50%); /* Only translateY needed */
}


/* Chapter 5 more details */
.more-details-link {
    position:fixed; /* Position it relative to its parent (chapter-container) */
    bottom: 10vh; /* Adjust as needed for vertical positioning from the bottom */
    right: 5vw; /* Adjust as needed for horizontal positioning from the right */
    background-color: transparent; /* Or a color that matches your design */
    padding: 10px 15px; /* Add some padding around the text */
    border: 0px solid #000; /* Optional: Add a border for a "box" look */
    text-align: center;
    cursor: pointer; /* Indicates it's clickable */
    z-index: 10; /* Ensure it's above other content if there's overlap */
}

.more-details-link a {
    color: rgb(233, 147, 72); /* Or your desired link color */
    text-decoration: underline; /* Make the text underlined */
    font-weight: bold; /* Make the text bold */
    font-size: 1.1em; /* Adjust font size as needed */
    display: block; /* Make the entire div clickable */
}

/* To hide it by default and show it only when needed (controlled by JS) */
.more-details-link.hidden {
    display: none;
}

