/* ---------- JKCI Header Styles ---------- */

.jkci-topbar {
    background: #ffffff;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    padding: 6px 0;
}

.jkci-topbar .topbar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.jkci-topbar .top-contact {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 18px;
    align-items: center;
}

.jkci-topbar .top-contact li a {
    color: #333;
    text-decoration: none;
}

.jkci-topbar .top-contact li i {
    margin-right: 5px;
    color: #55acee;
}

.jkci-topbar .btn-link {
    margin-left: 12px;
    text-decoration: none;
    font-weight: 600;
    color: #55acee;
}

.jkci-topbar .btn-link img {
    vertical-align: middle;
    margin-right: 6px;
}

/* Branding row */
.branding-bar {
    padding: 20px 0;
}

.branding-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.branding-left, .branding-right {
    flex: 0 0 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.branding-center {
    flex: 1 1 auto;
    text-align: center;
}

.coat-of-arms {
    max-height: 90px;
    width: auto;
    display: block;
}

.jkci-logo {
    max-height: 110px;
    width: auto;
    display: block;
}

/* Center text lines */
.country-line {
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 20px;
    letter-spacing: 2px;
    color: #111;
    font-weight: 600;
}

.org-line {
    font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
    font-size: 36px;
    color: #55acee;
    font-weight: 800;
    letter-spacing: 1px;
    margin-top: 6px;
}

/* ========== ENHANCED JKCI NAVIGATION STYLES ========== */

/* Navigation bar with enhanced background */
.jkci-nav-wrap {
    background: #55acee;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1000;
    overflow: visible !important;
}

/* Animated background elements */
.jkci-nav-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.jkci-nav-wrap:hover::before {
    left: 100%;
}

/* Enhanced navigation container */
.jkci-nav-wrap .nav-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    position: relative;
    z-index: 1001;
}

/* Enhanced mobile toggle button with animation */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
    z-index: 1002;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    transform: scale(1.05);
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: #fff;
    margin: 2px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    border-radius: 2px;
}

.mobile-menu-toggle.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
    background: #ffd6d6;
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
    background: #ffd6d6;
}

/* Enhanced navigation menu */
.jkci-navigation {
    position: relative;
    z-index: 1003;
}

/* FIXED: Remove large gaps between nav items */
.jkci-navigation ul.navbar-nav {
    display: flex;
    align-items: center;
    gap: 2px !important; /* Reduced from 18px to 2px */
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    z-index: 1004;
}

/* FIXED: Remove all list styling dots */
.jkci-navigation ul,
.jkci-navigation li,
.jkci-navigation .dropdown-menu,
.jkci-navigation .dropdown-menu li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.jkci-topbar ul,
.jkci-topbar li,
.jkci-topbar .dropdown-menu,
.jkci-topbar .dropdown-menu li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Enhanced nav links with animations */
.jkci-navigation .nav-link {
    color: #fff;
    text-decoration: none;
    padding: 16px 18px !important; /* Reduced padding */
    display: inline-block;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 6px 6px 0 0;
    background: transparent;
    margin: 0 1px !important;
}

.jkci-navigation .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffd6d6, #ff6b6b);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    border-radius: 2px 2px 0 0;
}

.jkci-navigation .nav-link:hover {
    color: #ffd6d6;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.jkci-navigation .nav-link:hover::before {
    width: 80%;
}

.jkci-navigation .nav-item.active > .nav-link {
    color: #ffd6d6;
    background: rgba(255, 255, 255, 0.15);
}

.jkci-navigation .nav-item.active > .nav-link::before {
    width: 100%;
    background: linear-gradient(90deg, #ffd6d6, #ff6b6b);
}

/* ========== CRITICAL DROPDOWN FIXES ========== */

.jkci-navigation .nav-item.dropdown {
    position: relative;
    z-index: 1005;
}

/* Enhanced dropdown menus - FIXED Z-INDEX */
.jkci-navigation .dropdown-menu {
    background: linear-gradient(135deg, #2c80c5 0%, #1e5d8a 100%) !important;
    border: none !important;
    margin-top: 0 !important;
    min-width: 240px;
    padding: 6px 0 !important; /* Reduced padding */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
    border-radius: 0 0 12px 12px !important;
    backdrop-filter: blur(10px);
    border-top: 3px solid #ffd6d6 !important;
    animation: dropdownSlideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top center;
    position: absolute !important;
    z-index: 9999 !important;
    display: none;
}

.jkci-navigation .dropdown-menu.show {
    display: block !important;
}

@keyframes dropdownSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.jkci-navigation .dropdown-item {
    color: #fff !important;
    padding: 10px 20px !important; /* Reduced padding */
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none !important;
    background: transparent !important;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    list-style: none !important;
}

.jkci-navigation .dropdown-item::before {
    content: '';
    position: absolute;
    left: -100%;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.jkci-navigation .dropdown-item:hover::before {
    left: 100%;
}

.jkci-navigation .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffd6d6 !important;
    padding-left: 28px !important;
    transform: translateX(5px);
}

/* Enhanced submenu styling */
.dropdown-submenu {
    position: relative;
    z-index: 1006;
    list-style: none !important;
}

.dropdown-submenu > .dropdown-menu.submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: -8px;
    background: linear-gradient(135deg, #1e5d8a 0%, #164a70 100%) !important;
    padding: 6px 0 !important; /* Reduced padding */
    min-width: 220px;
    border-radius: 0 12px 12px 12px !important;
    box-shadow: 5px 5px 25px rgba(0, 0, 0, 0.2) !important;
    animation: submenuSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 3px solid #ff6b6b !important;
    z-index: 10000 !important;
}

.dropdown-submenu:hover > .dropdown-menu.submenu {
    display: block;
}

@keyframes submenuSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Enhanced submenu arrow */
.dropdown-submenu .dropdown-submenu-toggle::after {
    content: "▸";
    border: none;
    float: right;
    font-size: 1.2em;
    line-height: 1;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.dropdown-submenu:hover .dropdown-submenu-toggle::after {
    transform: rotate(90deg);
    color: #ffd6d6;
}

/* Enhanced active states */
.jkci-navigation .nav-item.active > .nav-link {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Focus states for accessibility */
.jkci-navigation .nav-link:focus,
.jkci-navigation .dropdown-item:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: -2px;
    background: rgba(255, 255, 255, 0.2);
}

/* Ensure icons are visible */
.icon-phone-handset:before {
    content: "📞";
}

.icon-envelope:before {
    content: "✉️";
}

.icon-map-marker:before {
    content: "📍";
}

/* Fix for Bootstrap 5 dropdown compatibility */
.jkci-navigation .dropdown-toggle::after {
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-left: 0.3em solid transparent;
    margin-left: 0.5em;
}

/* Enhanced Desktop Styles */
@media (min-width: 992px) {
    .mobile-menu-toggle {
        display: none !important;
    }

    .jkci-navigation .nav-link {
        margin: 0 1px !important;
    }

    .jkci-navigation .dropdown-menu {
        border-radius: 0 0 12px 12px !important;
    }

    .jkci-navigation .nav-link:hover {
        background: rgba(255, 255, 255, 0.15);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    /* Enhanced dropdown hover behavior */
    .jkci-navigation .nav-item.dropdown:hover > .dropdown-menu {
        display: block;
        animation: dropdownSlideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .dropdown-submenu:hover > .dropdown-menu.submenu {
        display: block;
        animation: submenuSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* ========== FIXED MOBILE RESPONSIVE STYLES ========== */
@media (max-width: 991px) {
    /* Branding adjustments */
    .branding-left, .branding-right {
        flex: 0 0 80px;
    }

    .coat-of-arms {
        max-height: 60px;
    }

    .jkci-logo {
        max-height: 70px;
    }

    .org-line {
        font-size: 22px;
    }

    .country-line {
        font-size: 14px;
    }

    /* Topbar adjustments */
    .top-contact {
        display: none !important;
    }

    .translate-wrap {
        display: none;
    }

    /* Navigation container */
    .jkci-nav-wrap .nav-inner {
        flex-wrap: wrap;
        padding: 8px 0;
    }

    /* Mobile toggle button */
    .mobile-menu-toggle {
        display: flex !important;
        order: 2;
    }

    /* Enhanced mobile navigation container */
    .jkci-navigation {
        width: 100%;
        margin-top: 8px;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 12px;
        padding: 0;
        order: 3;
        flex-basis: 100%;
        display: none;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 1003;
    }

    /* Show menu when mobile-menu-open class is added */
    .jkci-navigation.mobile-menu-open {
        display: block !important;
        animation: mobileMenuSlideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    @keyframes mobileMenuSlideDown {
        from {
            opacity: 0;
            transform: translateY(-20px) scale(0.95);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    .jkci-navigation ul.navbar-nav {
        flex-direction: column;
        gap: 0 !important;
        width: 100%;
        margin: 0 !important;
        padding: 0 !important;
    }

    .jkci-navigation .nav-item {
        width: 100%;
        list-style: none !important;
    }

    .jkci-navigation .nav-link {
        padding: 14px 20px !important; /* Reduced padding */
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        transition: all 0.3s ease;
        border-radius: 0;
        margin: 0 !important;
    }

    .jkci-navigation .nav-link::before {
        display: none;
    }

    .jkci-navigation .nav-link:hover {
        background: rgba(255, 255, 255, 0.15);
        padding-left: 25px !important;
        transform: none;
    }

    /* FIXED: Mobile Dropdown Arrows */
    .jkci-navigation .dropdown-toggle::after {
        content: "▸" !important;
        border: none !important;
        font-size: 1.2em;
        transition: transform 0.3s ease;
    }

    .jkci-navigation .dropdown.show .dropdown-toggle::after {
        transform: rotate(90deg) !important;
    }

    /* FIXED: Mobile Dropdown Menus - Ensure they show */
    .jkci-navigation .dropdown-menu {
        position: static !important;
        float: none !important;
        width: 100% !important;
        margin: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: rgba(0, 0, 0, 0.3) !important;
        padding: 0 !important;
        display: none !important;
        border-radius: 0 !important;
        animation: none;
        z-index: 1004 !important;
    }

    .jkci-navigation .dropdown-menu.show {
        display: block !important;
        animation: mobileDropdownSlide 0.3s ease;
    }

    @keyframes mobileDropdownSlide {
        from {
            opacity: 0;
            max-height: 0;
        }
        to {
            opacity: 1;
            max-height: 500px;
        }
    }

    .jkci-navigation .dropdown-item {
        padding: 12px 30px !important; /* Reduced padding */
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        display: flex;
        justify-content: space-between;
        align-items: center;
        list-style: none !important;
    }

    .jkci-navigation .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        padding-left: 35px !important;
        transform: none;
    }

    /* FIXED: Mobile Submenu Styling */
    .dropdown-submenu > .dropdown-menu.submenu {
        position: static !important;
        left: auto !important;
        top: auto !important;
        background: rgba(0, 0, 0, 0.4) !important;
        margin-left: 0 !important;
        width: 100% !important;
        display: none !important;
        border-radius: 0 !important;
        z-index: 1005 !important;
    }

    .dropdown-submenu > .dropdown-menu.submenu.show {
        display: block !important;
        animation: mobileDropdownSlide 0.3s ease;
    }

    .dropdown-submenu .dropdown-submenu-toggle::after {
        content: "▸" !important;
        border: none !important;
        font-size: 1.2em;
        transition: transform 0.3s ease;
    }

    .dropdown-submenu.active .dropdown-submenu-toggle::after {
        transform: rotate(90deg) !important;
    }

    /* Enhanced mobile behavior */
    .dropdown-submenu > .dropdown-menu.submenu {
        position: static;
        margin-left: 15px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: none;
        box-shadow: none;
    }

    /* Enhanced scrolling on mobile */
    .jkci-navigation.mobile-menu-open {
        max-height: 70vh;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    }

    .jkci-navigation.mobile-menu-open::-webkit-scrollbar {
        width: 6px;
    }

    .jkci-navigation.mobile-menu-open::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
    }

    .jkci-navigation.mobile-menu-open::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 3px;
    }

    .jkci-navigation.mobile-menu-open::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.5);
    }
}

/* Enhanced touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .jkci-navigation .nav-link,
    .jkci-navigation .dropdown-item {
        min-height: 50px;
        display: flex;
        align-items: center;
        padding: 15px 20px;
    }

    .jkci-navigation .nav-link:active,
    .jkci-navigation .dropdown-item:active {
        background: rgba(255, 255, 255, 0.2);
        transition: background 0.1s ease;
    }
}

/* Pulse animation for active items */
@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 214, 214, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(255, 214, 214, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 214, 214, 0);
    }
}

.jkci-navigation .nav-item.active > .nav-link:focus {
    animation: pulseGlow 1.5s infinite;
}

/* small helpers */
.text-end {
    text-align: right;
}

.text-center {
    text-align: center;
}

.ms-auto {
    margin-left: auto !important;
}

@media (max-width: 1199px) {
    .top-contact {
        display: none !important;
    }
}
