/* General Styles */
html {
    scroll-behavior: smooth;
}

.our-story-page {
    overflow-x: hidden;
}

/* Navbar Styles */
#navbar {
    transition: all 0.3s ease;
    position: fixed; /* Restore fixed positioning */
    width: 100%;
    z-index: 50;
    background-color: rgba(4, 55, 50, 0.9); /* Default background */
}

#navbar.scrolled {
    background-color: #043732;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.nav-link {
    position: relative;
    color: white;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: #ba9d41;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Mega Dropdown Styles */
.nav-dropdown-wrapper {
    position: static; /* Changed from relative */
}

.mega-dropdown {
    position: fixed; /* Changed from absolute */
    top: 80px; /* Fixed distance from top */
    left: 0;
    width: 100%; /* Full width */
    background-color: #043732;
    border-top: 1px solid #043732; /* Create seamless connection */
    margin-top: 0; /* Reset margin */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    z-index: 40;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Hover-based dropdown */
.nav-dropdown-wrapper:hover .mega-dropdown {
    max-height: 400px;
    padding: 2rem 0;
}

.nav-dropdown-wrapper:hover .nav-dropdown-trigger:after {
    content: '';
    position: absolute;
    bottom: -10px; /* Adjusted position */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #043732;
    z-index: 41;
}

.nav-dropdown-wrapper:hover #navbar {
    background-color: #043732;
}

.mega-dropdown-item {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border-radius: 4px;
    display: inline-block;
    width: 250px;
}

.mega-dropdown-item:hover {
    background-color: rgba(186, 157, 65, 0.1);
    transform: translateY(-2px);
}

.nav-dropdown-trigger {
    position: relative;
    cursor: pointer;
}

/* Hero Slideshow Styles */
.slide {
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide ul li {
    margin-bottom: 0.75rem;
}

.slide h2 {
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.slide.active {
    opacity: 1;
    z-index: 1;
    transform: translateX(0);
}

.slide-nav-btn {
    position: relative;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.slide-nav-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15%;
    right: 15%;
    height: 3px;
    background-color: transparent;
    transition: background-color 0.3s ease;
}

.slide-nav-btn.active {
    opacity: 1;
}

.slide-nav-btn.active::after {
    background-color: #ba9d41;
}

.slide-nav-btn.active .slide-number {
    background-color: #ba9d41;
}

/* Mobile Dropdown Styles */
.mobile-dropdown-toggle {
    cursor: pointer;
}

.mobile-dropdown-toggle svg {
    transition: transform 0.3s ease;
}

.mobile-dropdown-toggle.active svg {
    transform: rotate(180deg);
}

/* Improve mobile menu button visibility */
#mobile-menu-button {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    right: 0;
}

#mobile-menu-button:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

/* Ensure mobile button is properly aligned */
@media (max-width: 768px) {
    #navbar .container {
        padding-right: 10px;
    }
    
    #mobile-menu-button {
        margin-right: 0;
    }
}

/* Slideshow button fixes */
.slide-nav-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 0; /* Increased vertical padding */
    background: transparent !important;
    border: none;
    border-radius: 0;
    transition: all 0.3s ease;
    opacity: 0.9;
    cursor: pointer;
    z-index: 10;
    position: relative;
}

.slide-nav-btn:hover {
    background: transparent !important;
    opacity: 1;
}

/* Make the slide navigation container more visible */
#hero .absolute.bottom-10 {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: rgba(0, 0, 0, 0.7); /* Darker background for better visibility */
    padding: 0;
    margin: 0;
    z-index: 30;
    position: absolute; /* Ensure proper positioning */
}

/* Make slideshow navigation responsive */
@media (max-width: 768px) {
    #hero .absolute.bottom-10 {
        display: flex;
        justify-content: center;
        padding: 8px 0;
    }
    
    .slide-nav-btn {
        padding: 8px;
    }
    
    .slide-title {
        display: none; /* Hide text labels on mobile */
    }
    
    .slide-number {
        margin-right: 0; /* No margin needed without title */
        width: 30px;
        height: 30px;
    }
}

.slide {
    z-index: 1; /* Lower z-index than buttons */
}

/* Services section enhancements */
.services-list li {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.services-list li:hover {
    transform: translateX(5px);
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 0.25rem;
}

/* Add a subtle animation to gold dots */
.services-list .bg-lts-gold {
    transition: transform 0.3s ease;
}

.services-list li:hover .bg-lts-gold {
    transform: scale(1.5);
}

/* Animation Classes */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-item {
    opacity: 0;
    transform: translateY(20px);
}

/* Responsive text sizes and spacing */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem !important;
    }
    
    h2 {
        font-size: 2rem !important;
    }
    
    p, li {
        font-size: 1rem !important;
    }
    
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    section {
        padding-top: 60px !important;
        padding-bottom: 60px !important;
    }
    
    .mb-16 {
        margin-bottom: 2rem !important;
    }
}

/* Improve animation performance on mobile */
@media (max-width: 768px) {
    .services-list li:hover {
        transform: translateX(3px); /* Less movement on mobile */
    }
    
    /* Optimize animations for mobile */
    .stagger-item {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card Styling - Generic for service, location, whyus-benefit, pillar, policy */
.service-card, .location-card, .pillar-card, .core-value-card {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 0.5rem;
}

.service-card h3, .location-card h3, .pillar-card h3, .core-value-card h3, .core-value-card h4 {
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    letter-spacing: 0.01em;
}

.service-card:hover, .location-card:hover, .pillar-card:hover, .core-value-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
}

.service-image-container, .location-image-container { /* Apply common styles to both */
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid rgba(186, 157, 65, 0.2);
    box-shadow: 0 0 0 4px rgba(4, 55, 50, 0.05);
}

.service-card:hover .service-image-container,
.location-card:hover .location-image-container { /* Apply common hover styles */
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}



.learn-more-btn, .learn-more-location-btn, .learn-more-pillar-btn, .learn-more-core-value-btn {
    position: relative;
    font-weight: 500;
    padding-bottom: 4px;
    display: inline-flex;
    align-items: center;
}

.learn-more-btn::after, .learn-more-location-btn::after, .learn-more-pillar-btn::after, .learn-more-core-value-btn::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #ba9d41;
    transition: width 0.3s ease;
}

.service-card:hover .learn-more-btn::after,
.location-card:hover .learn-more-location-btn::after,
.pillar-card:hover .learn-more-pillar-btn::after,
.core-value-card:hover .learn-more-core-value-btn::after {
    width: 100%;
}

/* Overlay Styling - Generic for all overlays */
#service-overlay, #location-overlay, #pillar-overlay, #core-value-overlay {
    opacity: 1;
    z-index: 50;
    pointer-events: none;
    transition: all 0.3s ease;
}

#service-overlay.active, #location-overlay.active, #pillar-overlay.active, #core-value-overlay.active {
    pointer-events: auto;
}

#service-overlay .overlay-bg, #location-overlay .overlay-bg, #pillar-overlay .overlay-bg, #core-value-overlay .overlay-bg {
    opacity: 0;
    transition: opacity 0.5s ease;
}

#service-overlay.active .overlay-bg, #location-overlay.active .overlay-bg, #pillar-overlay.active .overlay-bg, #core-value-overlay.active .overlay-bg {
    opacity: 0.7;
}

/* Detail Panel Styling - Generic for all panels */
#service-detail, #location-detail {
    transform: translateX(100%) !important; /* Added !important */
    transition: transform 0.5s ease;
    z-index: 51;
    box-shadow: -5px 0 25px rgba(0,0,0,0.25);
    will-change: transform;
}

#service-overlay.active #service-detail,
#location-overlay.active #location-detail {
    transform: translateX(0) !important; /* Important to override any inline styles */
}

/* Update #whyus-benefit-detail to be a modal */
#pillar-detail, #core-value-detail {
    /* Positioning for modal */
    position: fixed; /* Ensure it's fixed relative to viewport */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8); /* Initial hidden state (scaled down, centered) */
    width: 90%; /* Responsive width */
    max-width: 768px; /* Max width for large screens */
    height: auto; /* Height adjusts to content */
    max-height: 90vh; /* Max height to prevent overflow */
    
    /* Animation properties */
    opacity: 0; /* Initially hidden */
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Smooth transition for scale/opacity/transform */
    
    /* Other styling */
    border-radius: 0.5rem; /* Rounded corners for the modal */
    overflow-y: auto; /* Enable scrolling if content overflows */
    z-index: 51; /* Keep above overlay background */
    box-shadow: 0 10px 40px rgba(0,0,0,0.4); /* Stronger shadow for modal */
    will-change: transform, opacity; /* Optimize animation */
}

/* Active state for modal */
#pillar-overlay.active #pillar-detail,
#core-value-overlay.active #core-value-detail {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1); /* Final visible state (scaled to full size, centered) */
}

/* Adjust closing animation for modal */
#service-detail.closing, #location-detail.closing, #pillar-detail.closing, #core-value-detail.closing {
    transition-timing-function: ease-in;
}

.panel-handle {
    display: none;
}

/* Refined Mobile Media Query for Overlays */
@media (max-width: 639px) {
    /* Styles for SIDE-SLIDING PANELS on mobile (bottom-slide behavior) */
    #service-detail, #location-detail {
        position: fixed; /* Override absolute for mobile */
        bottom: 0;
        left: 0;
        right: 0;
        top: auto; /* Reset top to auto for bottom placement */
        height: 90vh; /* Make them tall sliding from bottom */
        border-radius: 16px 16px 0 0; /* Rounded top corners */
        width: 100%; /* Full width on mobile */
        max-width: none; /* No max width override */
        /* Initial hidden state for bottom-sliding panels on mobile */
        transform: translateY(100%) !important; /* Ensure they slide from bottom */
        transition: transform 0.5s ease; /* Ensure transition exists */
    }
    /* Active state for bottom-sliding panels on mobile */
    #service-overlay.active #service-detail,
    #location-overlay.active #location-detail {
        transform: translateY(0) !important;
    }
    /* Closing state for bottom-sliding panels on mobile */
    #service-detail.closing, #location-detail.closing {
        transform: translateY(100%) !important;
    }

    /* Styles for CENTERED MODAL PANELS on mobile */
    #pillar-detail, #core-value-detail {
        /* These explicitly override the broad mobile styles to keep them centered */
        position: fixed; /* Ensure it's fixed relative to viewport */
        top: 50%;
        left: 50%;
        /* Initial hidden state for modals on mobile (scaled down, centered) */
        transform: translate(-50%, -50%) scale(0.8);
        width: 95%; /* Wider on small screens */
        max-width: none; /* No max width for very small screens */
        max-height: 95vh; /* Allow it to be taller on mobile */
        border-radius: 0.5rem; /* Keep some border radius */
        /* Ensure transitions are applied from their general rules (defined outside this media query) */
    }
    /* Active state for modals is handled by their general rules outside this media query */
    /* Closing state for modals is handled by their general rules outside this media query */


    /* Panel handle (keep hidden for all as per previous design decisions) */
    .panel-handle {
        display: none;
    }
    
    /* Existing mobile-specific styles for images/icons - no change needed here */
    .service-image-container, .location-image-container {
        width: 120px;
        height: 120px;
    }
}

/* Policy Accordion Styles */
.policy-accordion-item {
    transition: all 0.3s ease;
}

.policy-accordion-summary {
    cursor: pointer;
    display: flex; /* Ensure flexbox for alignment */
    align-items: center; /* Align icon and text vertically */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.policy-accordion-summary {
    padding-bottom: 1rem; /* Add some space between summary and content */
    border-bottom: 1px solid rgba(0,0,0,0.1); /* Separator */
    margin-bottom: 1rem;
}

.policy-accordion-summary::-webkit-details-marker {
    display: none; /* Hide default triangle icon */
}

.policy-accordion-summary:focus {
    outline: none; /* Remove default focus outline */
}

.policy-accordion-item[open] .policy-accordion-summary {
    border-bottom-color: rgba(4, 55, 50, 0.3); /* Darker border when open */
}

.policy-accordion-item[open] .chevron-icon {
    transform: rotate(180deg);
}

.policy-accordion-content {
    /* Styles for content when visible, no special height transition needed for 'details' tag */
    overflow: hidden; /* Added for smooth height transition */
}

.policy-accordion-content {
    padding-top: 1rem;
}

/* Removed old .policy-card styles */
/*
.policy-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.policy-card h3, .policy-card h4 {
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    letter-spacing: 0.01em;
}
.policy-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
}
*/
