/* ============================================================================
   3. GLOBAL COMPONENTS
   ============================================================================
   Shared components used across all pages: Header, Footer, Navigation,
   Buttons, Forms, Cards, Badges, etc.
   ============================================================================ */

/* === Global Utility Classes === */

/* Badge Icon - Used across multiple pages */
.badge-icon {
    font-size: 1.1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

/* === NEW CLEAN HEADER & NAVIGATION === */

/* Main Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background: linear-gradient(135deg, #1a472a 0%, #2d5a3d 50%, #1a472a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 5%;
    max-width: 100%;
    min-height: 80px;
}

/* Logo - Far Left */
.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
    z-index: 10;
}

.header-logo .logo-img {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.header-logo:hover .logo-img {
    transform: scale(1.05);
}

.header-logo .logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.header-logo .logo-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    font-family: var(--font-heading);
}

.header-logo .logo-city {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.05em;
}

/* Navigation - Centered */
.main-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1.25rem;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-menu > li > a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-menu > li > a.active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

/* Dropdown */
.has-dropdown {
    position: relative;
}

.dropdown-arrow {
    display: inline-block;
    vertical-align: middle;
    transition: transform 0.3s ease;
    margin-left: 0.35rem;
    width: 12px;
    height: 12px;
}

.has-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    list-style: none;
    margin: 0;
    z-index: 100;
}

.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 0.75rem 1rem;
    color: #1e293b;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.dropdown-menu li a:hover {
    background: var(--primary-green);
    color: #fff;
}

/* Header Actions - Right Side */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 10;
}

.search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Search Panel */
.search-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    padding: 1.5rem 4%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.search-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-panel-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.search-panel input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-panel input:focus {
    outline: none;
    border-color: var(--primary-green);
}

.search-close {
    width: 40px;
    height: 40px;
    background: #f1f5f9;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-close:hover {
    background: #e2e8f0;
}

/* Scroll Progress Bar */
.scroll-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-green), var(--secondary-green));
    width: 0%;
    transition: width 0.1s ease-out;
}

/* Scrolled State */
.site-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.site-header.scrolled .header-logo .logo-name {
    color: #1e293b;
}

.site-header.scrolled .header-logo .logo-city {
    color: var(--primary-green);
}

.site-header.scrolled .nav-menu > li > a {
    color: #1e293b;
}

.site-header.scrolled .nav-menu > li > a:hover,
.site-header.scrolled .nav-menu > li > a.active {
    background: rgba(34, 197, 94, 0.14);
    color: var(--primary-green-dark);
}

.site-header.scrolled .nav-menu > li > a.active {
    background: var(--primary-green);
    color: #fff;
}

.site-header.scrolled .search-toggle {
    background: #f1f5f9;
    color: #1e293b;
}

.site-header.scrolled .search-toggle:hover {
    background: var(--primary-green);
    color: #fff;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    order: 3; /* Ensure it appears after logo on mobile */
    flex-shrink: 0;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
}

.site-header.scrolled .hamburger-line {
    background: #1e293b;
}

/* Keep hamburger visible with dark background on scroll */
.site-header.scrolled .mobile-menu-toggle {
    background: rgba(30, 41, 59, 0.1);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Navigation Footer */
.mobile-nav-footer {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        background: #fff;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding: 100px 1.5rem 2rem;
        padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
        transition: right 0.3s ease;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
        transform: none;
        left: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .main-nav.active {
        right: 0;
    }

    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        width: 100%;
        flex-grow: 0;
        flex-shrink: 0;
    }

    .nav-menu > li > a {
        color: #1e293b;
        padding: 1rem;
        border-radius: 10px;
        width: 100%;
    }

    .nav-menu > li > a:hover {
        background: var(--primary-green);
        color: #fff;
    }

    .dropdown-menu,
    .sub-menu {
        position: static;
        display: none;
        flex-direction: column !important;
        align-items: stretch;
        opacity: 0;
        visibility: hidden;
        transform: none;
        box-shadow: none;
        padding: 0 0 0 1rem;
        background: transparent;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.3s ease;
    }

    .dropdown-menu li,
    .sub-menu li {
        display: block;
        width: 100%;
    }

    .has-dropdown.dropdown-open .dropdown-menu,
    .menu-item-has-children.dropdown-open > .sub-menu {
        display: flex !important;
        flex-direction: column;
        opacity: 1;
        visibility: visible;
        max-height: 500px;
    }

    .has-dropdown.dropdown-open .dropdown-arrow {
        transform: rotate(180deg);
    }

    .dropdown-menu li a,
    .sub-menu li a {
        color: #64748b;
    }

    .dropdown-menu li a:hover,
    .sub-menu li a:hover {
        background: var(--primary-green);
        color: #fff;
    }

    .mobile-menu-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative;
        margin-left: auto;
        order: 2;
        z-index: 1001;
    }

    .mobile-menu-toggle .hamburger-line {
        display: block !important;
        width: 22px;
        height: 3px;
        background-color: #ffffff !important;
    }

    .header-actions {
        margin-left: 0.5rem;
        order: 3;
    }

    .header-logo {
        order: 1;
    }

    .mobile-nav-footer {
        display: block;
        margin-top: auto;
        padding-top: 2rem;
        padding-bottom: env(safe-area-inset-bottom, 1rem);
        border-top: 1px solid #e2e8f0;
        flex-shrink: 0;
    }

    .mobile-social {
        display: flex;
        gap: 1rem;
    }

    .mobile-social a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: #f1f5f9;
        border-radius: 10px;
        color: #64748b;
        transition: all 0.3s ease;
    }

    .mobile-social a:hover {
        background: var(--primary-green);
        color: #fff;
    }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 0.75rem 1rem;
        min-height: 70px;
    }

    .header-logo .logo-img {
        width: 38px;
        height: 38px;
    }

    .header-logo .logo-name {
        font-size: 1.25rem;
    }

    .header-logo .logo-city {
        font-size: 0.75rem;
    }
}

/* === Footer === */
.site-footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 25%, #334155 50%, #1e293b 75%, #0f172a 100%);
    color: var(--white);
    padding: 4rem 0 0;
    margin-top: 6rem;
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary-green), var(--secondary-green), var(--primary-green-dark), transparent);
}

.footer-content {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1.2fr;
    gap: 2rem;
    max-width: 1280px;
    margin: 0 auto 3rem;
    padding: 0 6%;
    position: relative;
    z-index: 2;
    align-items: start;
}

.footer-section {
    min-width: 0;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.footer-logo-img {
    width: 78px;
    height: 78px;
    object-fit: contain;
}

.footer-section h3,
.footer-section h4 {
    color: var(--white);
    margin-bottom: 1.2rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.2;
}

.footer-section h3 {
    font-size: 1.5rem;
    color: var(--primary-green);
}

.footer-brand p,
.footer-section p {
    color: var(--gray-300);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-social {
    display: flex;
    gap: 0.65rem;
    margin-top: 1.1rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--gray-200);
    text-decoration: none;
    transition: all 0.25s ease;
}

.social-link:hover {
    background: var(--primary-green);
    color: var(--white);
    transform: translateY(-2px);
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.55rem;
}

.footer-links a {
    color: var(--gray-300);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.35;
    transition: color 0.25s ease, transform 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.footer-links a:hover {
    color: var(--primary-green);
    transform: translateX(3px);
}

.footer-links a[target="_blank"]::after {
    content: '↗';
    font-size: 0.75rem;
    opacity: 0.65;
}

.footer-smiley a {
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid rgba(34, 197, 94, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.footer-smiley a:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(34, 197, 94, 0.25);
}

.smiley-report-img {
    display: block;
    width: 100%;
    max-width: 280px;
    height: auto;
}

.footer-bottom {
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    padding: 1.8rem 6%;
    position: relative;
    z-index: 2;
}

.footer-bottom-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-bottom p {
    margin: 0;
    color: var(--gray-300);
}

.footer-bottom-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom-links a {
    color: var(--gray-300);
    text-decoration: none;
    transition: color 0.25s ease;
}

.footer-bottom-links a:hover {
    color: var(--primary-green);
}

.footer-tagline-wrapper {
    max-width: 1280px;
    margin: 0.8rem auto 0;
}

.footer-tagline {
    margin: 0;
    color: #dbeafe;
    font-weight: 600;
}

@media (max-width: 768px) {
    .footer-bottom-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-tagline {
        font-size: 0.95rem;
    }
}

