/* --- Global Styles with New Color Palette (V3) --- */
body {
    /* CHANGED: Switched to the light mint background */
    background-color: #DDF4E7; 
    font-family: sans-serif;
    /* CHANGED: Switched to dark text for readability on the light background */
    color: #124170;
    margin: 0;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.is-hidden {
    display: none !important;
}

/* MODIFIED: Button styles are reversed for the new light theme */
.primary {
    /* A deep blue button now stands out as primary */
    background-color: #124170; 
    color: #FFFFFF; /* Light mint text for contrast */
    font-weight: bold;
    cursor: pointer;
}

.secondary {
    /* An outline button works well as a secondary action */
    background-color: transparent;
    color: #124170; 
    border: 1px solid #124170; 
}

/* --- Header --- */
header {
    padding-top: 20px;
    display: flex;
    justify-content: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    /* CHANGED: Header background is now light mint */
    background-color: #DDF4E7;
    transition: top 0.4s ease-in-out, background-color 0.4s ease;;
}

header.is-hidden {
    top: -150px;
}

nav {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 1350px;
    /* CHANGED: Border color switched to a subtle dark version */
    border-bottom: 1px solid rgba(18, 65, 112, 0.2); 
    padding-bottom: 20px;
}

nav .logo {
    width: 110px;
    object-fit: contain;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo img {
    width: 100%;
    height: auto;
    margin-top: 5px;
}

nav ul {
    display: flex;
    gap: 20px;
}

nav .buttons {
    display: flex;
    gap: 10px;
}

/* --- Main Content --- */
main {
    max-width: 100%;
    margin: 0 auto;
    overflow: visible;
    position: relative;
    z-index: 2;
}

/* Hide mobile-only buttons on desktop */
.hamburger-menu,
.close-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

/* On desktop, this wrapper just helps group the links and buttons */
.nav-content-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    overflow: visible;
}

/* Prevent body scrolling when the mobile menu is open */
body.no-scroll,
html.no-scroll {
    overflow: hidden;
}


/* --- START: Mobile Styles for Navbar --- */
@media screen and (max-width: 992px) {
    nav {
        padding: 0px 20px 20px 15px;
    }

    .hamburger-menu {
        display: flex;
        flex-direction: column;
        gap: 5px;
        padding: 0;
        background: none;
        border: none;
        cursor: pointer;
        /* Give it a z-index to stay on top of the menu */
        position: relative;
        z-index: 2001;
    }


    .hamburger-menu span {
        display: block;
        width: 25px;
        height: 3px;
        background-color: #124170;
        border-radius: 3px;
        transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    }
    
    .hamburger-menu.is-open span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger-menu.is-open span:nth-child(2) {
        opacity: 0;
    }

    .hamburger-menu.is-open span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Transform the wrapper into the dropdown menu */
    .nav-content-wrapper {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        position: fixed;
        /* Position it below the header (adjust 90px if your header height is different) */
        top: 60px; 
        left: 0;
        width: 100%;
        height: calc(100vh - 120px); /* Fill the rest of the screen */
        
        /* Change background to match the navbar */
        background-color: #DDF4E7; 
        
        padding: 0px 70px 40px 30px;
        box-sizing: border-box;
        z-index: 2000;
        
        /* Animate it by scaling down from the top for a dropdown effect */
        transform-origin: top;
        transform: scaleY(0);
        transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    }
    
    /* This class will be toggled by JS to show/hide the menu */
    .nav-content-wrapper.is-open {
        transform: scaleY(1);
        padding: 0px 30px 40px 30px;
    }

    /* Restyle the nav links for the vertical, left-aligned layout */
    .nav-content-wrapper ul {
        flex-direction: column;
        /* Align items to the start (left) */
        align-items: flex-start; 
        width: 100%;
        gap: 0; /* Remove gap, use padding/border on items instead */
    }

    .nav-content-wrapper li {
        width: 100%;
        border-bottom: 1px solid #124170;
    }
    
    body.dark-theme .nav-content-wrapper li {
        border-bottom: 1px solid #FFFFFF;
    }
    
    .nav-content-wrapper li a {
        /* Make text dark to be readable on the light background */
        color: #124170;
        font-size: 1.2rem;
        font-weight: 500;
        display: block; /* Make the whole area clickable */
        padding: 20px 0;
    }

    /* Restyle the buttons to be in a row at the bottom */
    .nav-content-wrapper .buttons {
        flex-direction: row;
        gap: 10px;
        width: 100%;
    }
    
    .nav-content-wrapper .buttons button {
        /* Let buttons share the space */
        flex: 1;
        padding: 14px;
        font-size: 1rem;
    }
    
    /* Ensure buttons use the correct style for a light background */
    .nav-content-wrapper .primary {
        background-color: #124170;
        color: #DDF4E7;
    }

    .nav-content-wrapper .secondary {
        background-color: transparent;
        color: #124170;
        border: 1px solid #124170;
    }

    main {
        padding-top: 20px;
    }
}


/* Caret (arrow) styling */
.caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    vertical-align: middle;
    border-top: 5px solid;
    border-right: 5px solid transparent;
    border-left: 5px solid transparent;
    transition: transform 0.3s ease;
    transform: rotate(0deg);
}

.has-dropdown {
    position: relative;
    cursor: pointer;
}

.has-dropdown.is-open > a .caret {
    transform: rotate(180deg);
}

/* ADD THIS RULE for the dropdown menu */
.has-dropdown.is-open > .dropdown-menu {
    display: block;
}

.dropdown-menu {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(18, 65, 112, 0.1);
    min-width: 200px;
    z-index: 1001;
    padding: 8px 0;
    list-style: none;
    margin-top: 10px; /* Space between nav link and dropdown */
}

.dropdown-menu li a {
    display: block;
    padding: 12px 20px;
    color: #124170;
    font-size: 0.95rem;
    white-space: nowrap;
}

.dropdown-menu li a:hover {
    background-color: rgba(221, 244, 231, 0.5); /* Light mint hover effect */
}


/* --- START: Mobile Styles for Dropdown (Accordion) --- */
@media screen and (max-width: 992px) {
    /* Reset desktop dropdown styles */
    .dropdown-menu {
        display: block; /* Make it part of the layout flow */
        position: static;
        background-color: transparent;
        box-shadow: none;
        min-width: 100%;
        margin-top: 0;
        padding: 0;
        /* Hide with max-height for transition */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
    }

    .has-dropdown.is-open > .dropdown-menu {
        max-height: 300px; /* Animate open */
    }

    /* Indent submenu items */
    .dropdown-menu li a {
        padding-left: 20px;
        font-size: 1rem;
        font-weight: 400;
        color: #26667F; /* Use softer text color for submenu */
    }

    /* Point caret down on mobile */
    .caret {
         transform: rotate(0deg); /* Reset from desktop hover */
    }
    
    .has-dropdown > a .caret {
        position: absolute;
        right: 0;
        top: 28px;
        transform: rotate(-90deg); /* Points right */
    }

    .has-dropdown.is-open > a .caret {
        transform: rotate(90deg); /* Points down */
    }
    
    .has-dropdown > a {
        position: relative; /* Needed to position the caret */
    }
}

.demo-section {
    height: 100vh; /* Adjust 80px based on your header height */
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr; /* Give a bit more space to the left column */
    gap: 5rem;
    max-width: 1350px;
    width: 100%;
}

/* --- Left Panel --- */
.image-showcase {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.image-showcase img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.stats-container {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    display: none; /* Hide by default */
    gap: 1rem;
    align-items: flex-end;
    justify-content: flex-start;
}

.stats-container.active {
    display: flex; /* Show only the active one */
}

.stat-item {
    position: relative;
    flex: 1;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 50px 16px 20px 16px;
    text-align: start;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);

    height: 150px; /* <-- CHANGE THIS VALUE TO WHATEVER YOU NEED */

    box-sizing: border-box; 
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}

.stat-item p {
    color: #ffffff !important;
}

/* Adds the small dot in the top-left corner */
.stat-item::before {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 6px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin: 0 0 0.25rem 0;

    min-height: 1.5em; /* This reserves space for up to two lines */
    display: flex;
    align-items: center; /* This vertically centers the text */
    justify-content: center; /* This horizontally centers the text */
}

.stat-label {
    font-size: 0.875rem;
    margin: 0;
    opacity: 0.9;
}

.trusted-by {
    margin-top: 3rem;
    color: #4a4a4a;
}

.trusted-by-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
}

.logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
    opacity: 0.7;
}

/* --- Right Panel --- */
.demo-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.demo-form-panel h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #124170; /* Using your specified dark color for text */
}

.form-tabs {
    display: inline-flex;
    border: 1px solid #bdc3c7;
    border-radius: 25px;
    overflow: hidden;
    margin-bottom: 2rem;
    justify-content: space-between;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-size: 1rem;
    color: #34495e;
    width: 100%;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.tab-btn.active {
    color: #ffffff;
    border-radius: 25px;
}

form .form-content {
    display: none; /* Hide all form content by default */
    flex-direction: column;
    gap: 1rem;
}

form .form-content.active {
    display: flex; /* Show only the active form content */
    width: 100%;
}

form input[type="email"],
form input[type="text"] {
    width: 100%;
    padding: 1rem;
    border: 1px solid #bdc3c7;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #ffffff;
    box-sizing: border-box;
}

form input::placeholder {
    color: #95a5a6;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 8px;
    border: none;
    background-color: #124170;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #1a5a99;
}


/* --- Responsive Tablet and Mobile Styles --- */
@media (max-width: 992px) {
    .demo-grid {
        grid-template-columns: 1fr;
        gap: 4rem;
    }
    .demo-form-panel {
        order: -1; /* Move form to the top on smaller screens */
    }
    .demo-form-panel h1 {
        text-align: center;
    }
    .form-tabs {
        width: 100%;
        display: flex;
    }
    .tab-btn {
        flex: 1;
    }
}

@media (max-width: 576px) {
    .demo-section {
        padding: 2rem 1rem;
        margin-top: 50px;
    }
    .demo-form-panel h1 {
        font-size: 2rem;
    }
    .stats-overlay {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        bottom: 8px;
        left: 8px;
        right: 8px;
    }
    .stat-number {
        font-size: 1.5rem;
    }
    .logos {
        gap: 1rem 1.5rem;
        justify-content: center;
    }

    .stats-container.active {
        /* This is the key change to stack the flex items vertically */
        flex-direction: column;
        
        /* This makes each stacked item stretch to the full width of the container */
        align-items: stretch;
    }

    .stat-item {
        /* Let the height adjust automatically to its content on small screens */
        height: auto;
        
        /* Adjust padding for a better look when stacked */
        padding: 10px 16px;
    }

    .stat-number {
        font-size: 0.8rem; /* Slightly smaller number for better fit */
    }

    .stat-label {
        font-size: 0.65rem; /* Slightly smaller label for better fit */
    }
}

/* --- START: Dark Theme for 'Recruiting Agencies' Tab --- */

/* 1. Change body background and default text color */
body.dark-theme {
    background-color: #124170;
    color: #ffffff; /* Default text color to white */
    transition: background-color 0.4s ease;
}

/* 2. Update the main heading color */
body.dark-theme .demo-form-panel h1 {
    color: #ffffff;
}

/* 3. Update header navigation link colors */
body.dark-theme nav ul li a {
    color: #ffffff;
}

/* 4. Invert the secondary button style to work on a dark background */
body.dark-theme nav .buttons .secondary {
    color: #ffffff;
    border-color: #ffffff;
}

/* 5. Change the hamburger menu icon bars to white */
body.dark-theme .hamburger-menu span {
    background-color: #ffffff;
}

/* 6. Update the nav border to be a light, transparent color */
body.dark-theme nav {
    border-bottom-color: #ffffff;
}

body.dark-theme .tab-btn {
    color: #ffffff;
}

body.dark-theme .tab-btn.active {
    background-color: #ffffff;
    color: #124170;
}

body.dark-theme .submit-btn {
    background-color: #ffffff;
    color: #124170;
}

body.dark-theme input {
    background-color: #124170;
    border-color: #ffffff;
    color: #ffffff;
}

body.dark-theme .primary {
    color: #124170;
    background-color: #ffffff;
}

.logo {
    position: relative;
}
.logo-light,
.logo-dark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.5s ease-in-out;
}

/* 2. Prepare showcase image container and images */
.image-showcase {
    /* Define the aspect ratio on the container */
    aspect-ratio: 1 / 1;
}
.showcase-img-light,
.showcase-img-dark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease-in-out;
}
/* --- Opacity Rules for Light Theme (Default) --- */
.logo-light,
.showcase-img-light {
    opacity: 1;
}
.logo-dark,
.showcase-img-dark {
    opacity: 0;
}

/* --- Opacity Rules for Dark Theme --- */
body.dark-theme .logo-light,
body.dark-theme .showcase-img-light {
    opacity: 0;
}
body.dark-theme .logo-dark,
body.dark-theme .showcase-img-dark {
    opacity: 1;
}

.theme-transition-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    z-index: 1; 
    transform: translate(-50%, -50%);
    transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1), height 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none; 
}
.theme-transition-overlay.is-active {
    /* Use vmax (the larger of viewport width or height) to guarantee it covers the screen */
    width: 200vmax;
    height: 200vmax;
}

body,
.demo-form-panel h1,
nav ul li a,
.secondary,
.primary,
.submit-btn,
.tab-btn,
form input[type="email"],
form input[type="text"] {
    /* Transition these common properties for 0.4 seconds */
    transition: color 0.4s ease, 
                background-color 0.4s ease, 
                border-color 0.4s ease;
}

nav {
    /* Specifically for the nav's bottom border */
    transition: border-bottom-color 0.4s ease;
}

.hamburger-menu span {
    /* IMPORTANT: Add background-color to the existing hamburger transitions */
    transition: transform 0.3s ease-in-out, 
                opacity 0.3s ease-in-out, 
                background-color 0.4s ease;
}

/* --- Sliding Tab Indicator --- */
.form-tabs {
    /* Required to position the indicator inside */
    position: relative;
}

.tab-indicator {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: #124170;
    border-radius: 25px;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Sits below the button text */
    z-index: 1;
}

.tab-btn {
    /* Required for the text to appear above the indicator */
    position: relative;
    z-index: 2;
    /* Make the button's own background transparent */
    background-color: transparent;
}

/* Dark theme style for the indicator */
body.dark-theme .tab-indicator {
    background-color: #ffffff;
}

/* --- Stat Item Entrance Animation --- */

.stat-item {
    /* Initial state: hidden and moved down */
    opacity: 0;
    transform: translateY(20px);
    
    /* Animation settings */
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Staggered delays for the animation */
.stats-container.active .stat-item:nth-child(1) {
    transition-delay: 0s;
}
.stats-container.active .stat-item:nth-child(2) {
    transition-delay: 0.1s;
}
.stats-container.active .stat-item:nth-child(3) {
    transition-delay: 0.2s;
}

/* Final state: visible and in its original position */
.stats-container.active .stat-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.submission-message {
    text-align: center;
    margin-top: 20px;
    font-weight: bold;
    color: #124170;
}
body.dark-theme .submission-message {
    color: #ffffff;
}

body.dark-theme header {
    background-color: #124170;
}

body.dark-theme .nav-content-wrapper {
    background-color: #124170;
}