/* global.css - Shared styles, branding, and layout */

:root {
    /* Brand Colors */
    --cfn-green: #03A63C;
    --cfn-dark-green: #0B8C38;
    --cfn-mute-green: #46A66F;
    --cfn-light-green: #8BD9AD;
    
    /* Neutrals */
    --npt-black: #141414;
    --npt-white: #F8FAFC; /* Slightly off-white for less glare */
    --npt-grey: #e2e8f0;

    /* Typography */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
    
    /* Spacing */
    --spacing-md: 2rem;
    --spacing-lg: 4rem;

    /* Premium UI Tokens */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-blur: blur(12px) saturate(180%);
    --glow-green: 0 0 0 1px rgba(3, 166, 60, 0.15), 0 8px 24px rgba(3, 166, 60, 0.18), 0 20px 40px rgba(3, 166, 60, 0.08);
    --glow-green-hover: 0 0 0 1px rgba(3, 166, 60, 0.3), 0 12px 32px rgba(3, 166, 60, 0.28), 0 24px 48px rgba(3, 166, 60, 0.12);
    --transition-smooth: cubic-bezier(0.2, 0.8, 0.2, 1);
    --cfn-light-green-dim: rgba(139, 217, 173, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--npt-white);
    color: var(--npt-black);
    line-height: 1.7; /* Increased for readability */
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased; /* Smoother fonts on Mac */
}

/* Keep anchor targets visible beneath sticky headers */
[id] {
    scroll-margin-top: 120px;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em; /* Tighter headings look more modern */
}

/* --- Navigation --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: rgba(255, 255, 255, 0.98); /* Switch to White for Black Logo */
    backdrop-filter: blur(10px);
    color: var(--npt-black); /* Dark text for links */
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); /* Softer shadow */
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 45px; /* Adjust based on logo aspect ratio */
    width: auto;
    display: block;
}

/* Fallback if image fails */
.logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--cfn-green);
    margin-left: 0.5rem;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2.5rem;
    align-items: center; /* Vertically align items */
}

/* Container for nav items, specifically helpful for dropdowns */
.nav-links li {
    position: relative; 
    padding: 10px 0; /* Increase hit area vertically */
}

.nav-links a {
    text-decoration: none;
    color: var(--npt-black); /* Dark links against white header */
    font-weight: 600; /* Slightly bolder for visibility */
    font-size: 0.95rem;
    transition: color 0.3s ease;
    font-family: var(--font-heading);
    display: block; 
}

.nav-links a:hover, .nav-links a.active {
    color: var(--cfn-green); /* Green accent on hover */
}

/* --- Dropdown Menu Styles --- */
.dropdown-menu {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%; /* Position directly below the parent li */
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    min-width: 180px; /* Slightly wider */
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); /* Stronger shadow */
    border-radius: 8px;
    padding: 10px 0;
    z-index: 1001;
    border: 1px solid rgba(0,0,0,0.05);
    margin-top: 0; /* Remove top margin gap */
    
    /* Invisible bridge to prevent mouse-leave when moving from button to menu */
    padding-top: 15px; 
    clip-path: inset(0 -20px -20px -20px); /* Expand interactive area */
}

/* Inner wrapper to handle padding/clip-path offset */
.dropdown-menu::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 15px; /* Height of the bridge */
    background: transparent;
}

/* Arrow indicator for dropdown parent */
.dropdown-toggle::after {
    content: '\f078'; /* FontAwesome chevron-down */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7em;
    margin-left: 6px;
    vertical-align: middle;
    transition: transform 0.2s;
    display: inline-block;
}

/* Hover State - Show Menu */
.nav-links li:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

.nav-links li:hover .dropdown-menu {
    display: block;
    animation: fadeInDropdown 0.2s ease-out forwards;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Dropdown items */
.dropdown-menu li {
    width: 100%;
    padding: 0; /* Reset parent padding for list items */
}

.dropdown-menu a {
    padding: 12px 20px;
    white-space: nowrap;
    color: var(--npt-black);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-radius: 0;
    display: flex;
    align-items: center;
}

.dropdown-menu a:hover {
    background-color: #f0fdf4; /* Very light green bg */
    color: var(--cfn-green);
    padding-left: 25px; /* Slight slide effect */
}

.dropdown-menu i {
    width: 20px;
    text-align: center;
    color: #94a3b8;
    transition: color 0.2s;
}

.dropdown-menu a:hover i {
    color: var(--cfn-green);
}

/* Special styling for bill pay button in nav */
.btn-nav-highlight {
    background-color: var(--cfn-green);
    color: white !important;
    padding: 8px 22px;
    border-radius: 50px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(3, 166, 60, 0.2);
}

.btn-nav-highlight:hover {
    background-color: var(--cfn-dark-green);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(3, 166, 60, 0.3);
}

.btn-nav-highlight::after {
    color: white; /* Make arrow white for highlighted button */
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--npt-black); /* Dark icon */
}

/* --- Utility Classes --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg) 1.5rem;
}

.hidden {
    display: none !important;
}

.text-accent {
    color: var(--cfn-green);
}

/* --- Footer --- */
footer {
    background-color: var(--npt-black);
    color: #94a3b8; /* Muted text */
    text-align: center;
    padding: 3rem 1rem;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* --- Animations --- */
.fade-in-section, .fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}

.fade-in-section.is-visible, .fade-in.is-visible {
    opacity: 1;
    transform: none;
}

@media (max-width: 900px) {
    .nav-links { 
        display: none; 
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: white;
        padding: 1.5rem 5%;
        gap: 1.5rem;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        border-bottom: 1px solid var(--npt-grey);
    } 

    .nav-links.active {
        display: flex;
        animation: slideDown 0.3s ease-out forwards;
    }

    .nav-links li {
        width: 100%;
        padding: 0;
    }

    /* Reset Bill Pay Button to look like a normal link */
    .btn-nav-highlight {
        background-color: transparent !important;
        color: var(--npt-black) !important;
        padding: 10px 0 !important;
        box-shadow: none !important;
        border-radius: 0;
        width: 100%;
        text-align: left;
    }
    
    .btn-nav-highlight:hover {
        background-color: transparent;
        color: var(--cfn-green) !important;
        box-shadow: none;
        transform: none;
    }

    /* Show the arrow again (it was white and hidden on desktop hover state) */
    .dropdown-toggle::after {
        display: inline-block;
        color: var(--cfn-green);
        float: right;
        margin-right: 1rem;
        transform: rotate(180deg); /* Point up to indicate it is "open" */
    }

    /* Adjust dropdown menu to look like an indented sub-list */
    .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        display: block; /* Show nested items on mobile */
        opacity: 1;
        margin-top: 0;
        
        /* New sub-list styling */
        background: transparent;
        border-left: 2px solid var(--cfn-green);
        margin-left: 10px;
        padding-left: 0;
    }

    .dropdown-menu a {
        padding: 10px 15px;
        font-size: 0.9rem;
        color: #64748b; /* Lighter text for hierarchy */
    }

    .mobile-menu-btn { 
        display: block; 
    }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
