/* ==============================================
     PECODEX NAVIGATION SYSTEM
     Pure HTML/CSS/JS implementation
============================================== */

/* --- Reset and Basic Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- Layout Container --- */
.pecodex-container {
    width: 100%;
    max-width: 1320px;
    padding-left: 1rem;
    padding-right: 1rem;
    margin-left: auto;
    margin-right: auto;
}

/* --- Utility --- */
.pecodex-flex-center {
    display: flex;
    align-items: center;
}

/* --- Header Styles --- */
.pecodex-main-header {
    background-color: white;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    position: relative;
    z-index: 100;
}

/* --- Top Bar --- */
.pecodex-top-bar {
    border-bottom: 1px solid #dee2e6;
    padding: 0.5rem 0;
}
.pecodex-top-bar-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pecodex-logo-container img {
    height: 40px;
    width: auto;
}
.pecodex-contact-info-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
}
.pecodex-contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.pecodex-contact-item-icon {
    background-color: #006400;
    color: white;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    font-size: 1rem;
}
.pecodex-contact-item-text {
    font-size: 0.875rem;
}
.pecodex-contact-item-text p {
    margin: 0;
    line-height: 1.4;
}
.pecodex-contact-item-text .pecodex-title {
    font-weight: 600;
    color: #212529;
}
.pecodex-contact-item-text .pecodex-detail {
    color: #6c757d;
}
.pecodex-social-icons {
    display: flex;
    gap: 1rem;
    font-size: 1rem;
}
.pecodex-social-icons a {
    color: #6c757d;
    transition: color 0.3s;
}
.pecodex-social-icons a:hover {
    color: #198754;
}

/* --- Angled Desktop Navigation --- */
:root {
    --pecodex-slant-width: 50px;
    --pecodex-nav-height: 68px;
}
.pecodex-desktop-nav-container {
    height: var(--pecodex-nav-height);
    display: flex;
}
.pecodex-nav-section {
    position: relative;
    display: flex;
    align-items: center;
}
.pecodex-nav-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
}

.pecodex-nav-left-section {
    width: 28%;
    padding: 0 0.5rem 0 2rem;
    justify-content: space-between;
}
.pecodex-nav-left-section::before {
    background-color: #f8f9fa;
    clip-path: polygon(0 0, 100% 0, calc(100% - var(--pecodex-slant-width)) 100%, 0% 100%);
}
.pecodex-left-section-text {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
    padding-right: 1rem;
}

.pecodex-nav-center-section {
    flex-grow: 1;
    margin-left: calc(-1 * var(--pecodex-slant-width));
    padding-left: calc(var(--pecodex-slant-width) + 1rem);
    padding-right: calc(var(--pecodex-slant-width) + 1rem);
    justify-content: center;
}
.pecodex-nav-center-section::before {
     background-color: #228B22;
     clip-path: polygon(var(--pecodex-slant-width) 0, 100% 0, calc(100% - var(--pecodex-slant-width)) 100%, 0% 100%);
}

.pecodex-nav-right-section {
    width: 22%;
    margin-left: calc(-1 * var(--pecodex-slant-width));
    padding-left: calc(var(--pecodex-slant-width) + 1.5rem);
    padding-right: 2rem;
    gap: 1.5rem;
}
.pecodex-nav-right-section::before {
    background-color: #006400;
    clip-path: polygon(var(--pecodex-slant-width) 0, 100% 0, 100% 100%, 0% 100%);
}
.pecodex-search-icon {
    color: white;
    font-size: 1rem;
}

/* Desktop Nav Links & Dropdown */
.pecodex-desktop-nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.pecodex-desktop-nav-links li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pecodex-desktop-nav-links a {
    color: white;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    position: relative;
}

.pecodex-desktop-nav-links a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}
.pecodex-dropdown {
    position: relative;
}
.pecodex-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
    min-width: 160px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    z-index: 1050;
}
.pecodex-dropdown:hover .pecodex-dropdown-menu {
    display: block;
}

/* --- Invisible Gap Filler for Dropdown Hover --- */
.pecodex-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 20px; /* Adjust this value to match your gap */
    background: transparent;
    z-index: 1049; /* Just below the dropdown menu */
}

.pecodex-dropdown-menu::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 20px; /* Same as the gap filler above */
    background: transparent;
    z-index: 1049;
}
.pecodex-dropdown-menu a {
    color: #212529;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 0.95rem;
    transition: background-color 0.3s;
}
.pecodex-dropdown-menu a:hover {
    color: #198754;
}

.pecodex-dropdown-divider {
    height: 1px;
    background-color: #dee2e6;
    margin: 0.5rem 0;
    border: none;
}

/* --- Buttons --- */
.pecodex-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}
.pecodex-btn-green {
    background-color: #198754;
    color: white;
    border-color: #198754;
}
.pecodex-btn-green:hover {
    background-color: #157347;
}
.pecodex-btn-light {
    background-color: #f8f9fa;
    color: #000;
    border-color: #f8f9fa;
    flex-grow: 1;
}
.pecodex-btn-light:hover {
    background-color: #e2e6ea;
}

/* --- Mobile Navigation --- */
.pecodex-mobile-nav {
    display: none;
    padding: 0.5rem 0;
}
.pecodex-mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pecodex-mobile-logo img {
    height: 30px;
}
.pecodex-mobile-nav-toggle {
    background: none;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 0.25rem;
    padding: 0.25rem 0.75rem;
    font-size: 1.25rem;
    cursor: pointer;
}
.pecodex-mobile-nav-links {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out;
    background-color: #f8f9fa;
}
.pecodex-mobile-nav-links.pecodex-is-active {
    max-height: 500px; /* Large enough to show all content */
}
.pecodex-mobile-nav-links ul {
    padding: 1rem 0;
}
.pecodex-mobile-nav-links a {
    display: block;
    padding: 0.5rem 1rem;
    color: #212529;
}
.pecodex-mobile-nav-links .pecodex-btn {
    width: 100%;
    margin-top: 1rem;
}

/* --- Mobile Navigation Styles (Used for SPA Navigation) --- */
.mobile-main-nav {
    display: flex;
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.mobile-main-nav::-webkit-scrollbar {
    display: none;
}

.mobile-nav-link {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: #6c757d;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    scroll-snap-align: center;
    min-width: 90px;
    white-space: nowrap;
    position: relative;
    min-height: 60px;
    justify-content: center;
}

/* Enhanced touch targets for navigation links */
.mobile-nav-link::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: transparent;
    z-index: 1;
}

.mobile-nav-link:hover {
    color: #28a745;
    text-decoration: none;
}

.mobile-nav-link.active {
    color: #28a745;
    border-bottom-color: #28a745;
}

.mobile-nav-link svg {
    width: 20px;
    height: 20px;
    margin-bottom: 0.25rem;
}

.mobile-nav-link span {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Scroll indicators */
.mobile-nav-scroll-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.mobile-nav-scroll-indicator:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.mobile-nav-scroll-indicator:active {
    transform: translateY(-50%) scale(0.95);
}

.mobile-nav-scroll-indicator.left {
    left: 12px;
}

.mobile-nav-scroll-indicator.right {
    right: 12px;
}

.mobile-nav-scroll-indicator.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(0.8);
    transition: all 0.3s ease;
}

.mobile-nav-scroll-indicator {
    transition: all 0.3s ease, opacity 0.2s ease;
}

/* Click protection zones */
.mobile-nav-scroll-indicator::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: transparent;
    z-index: -1;
}

/* Enhanced touch targets */
.mobile-nav-scroll-indicator svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* Prevent accidental clicks on navigation when near scroll buttons */
.mobile-nav-container {
    position: relative;
}

.mobile-nav-container::before,
.mobile-nav-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    z-index: 999;
    pointer-events: none;
}

.mobile-nav-container::before {
    left: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.8), transparent);
}

.mobile-nav-container::after {
    right: 0;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.8), transparent);
}

/* Mobile navigation links container */
.mobile-main-nav-links {
    display: flex;
    gap: 0;
    align-items: center;
    width: 100%;
}

/* Responsive adjustments for very small screens */
@media (max-width: 480px) {
    .mobile-nav-link {
        padding: 0.5rem 0.75rem;
        min-width: 70px;
    }

    .mobile-nav-link span {
        font-size: 0.7rem;
    }

    .mobile-nav-link svg {
        width: 18px;
        height: 18px;
    }
}

/* --- SPA Desktop Sub-Header Styles --- */
.main-nav-link {
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 2px;
    padding: 0.75rem 1rem !important;
    min-width: 56px;
}

.main-nav-link:hover {
    background-color: rgba(34, 139, 34, 0.1);
    transform: translateY(-1px);
    color: #28a745 !important;
}

.main-nav-link.active {
    color: #28a745 !important;
    border-bottom: 2px solid #28a745 !important;
    box-shadow: 0 2px 8px rgba(34, 139, 34, 0.2);
}

.main-nav-link svg {
    margin-bottom: 0.25rem;
}

/* SPA Sub-header specific styles */
.navbar.sticky-top {
    z-index: 1020;
}

.navbar-brand h1 {
    color: #198754 !important;
}

.input-group-text.bg-light {
    background-color: #f8f9fa !important;
}

.form-control.bg-light {
    background-color: #f8f9fa !important;
}

.btn.rounded-circle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide mobile navigation on desktop for SPA */
@media (min-width: 992px) {
    .mobile-main-nav {
        display: none !important;
    }
}

/* --- Top Bar Icons --- */
.top-bar-icon {
    background-color: #006400;
    color: white;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
}

.social-icons a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.3s;
}

.social-icons a:hover {
    color: #198754;
}

/* --- Bootstrap Navbar Z-Index Fix --- */
.navbar.navbar-expand-lg.navbar-light.bg-white.shadow-sm.sticky-top {
    z-index: 50 !important;
}

/* --- Sidebar Z-Index Fix --- */
aside.col-lg-3.d-none.d-lg-block {
    z-index: 10 !important;
}

aside.col-lg-3.d-none.d-lg-block .sticky-top {
    z-index: 10 !important;
}

/* --- Responsive Breakpoints --- */
@media (max-width: 1200px) {
    .pecodex-left-section-text {
        display: none;
    }
}
@media (max-width: 992px) {
    .pecodex-top-bar, .pecodex-desktop-nav-container {
        display: none;
    }
    .pecodex-mobile-nav {
        display: block;
    }
    .pecodex-sub-header {
        display: none;
    }
}