/* Custom Header Styles - Dynamic Colors */

/* Force override Bootstrap default styles */
.navbar.custom-header {
    transition: all 0.3s ease;
    border: none !important;
}

.navbar.custom-header.bg-light {
    background: inherit !important;
    background-color: inherit !important;
}

.navbar.custom-header .navbar-brand {
    transition: all 0.3s ease;
}

.navbar.custom-header .nav-link {
    transition: all 0.3s ease;
}

.navbar.custom-header .nav-link:hover {
    opacity: 0.8 !important;
}

/* Logo positioning styles */
.navbar.custom-header .navbar-brand.logo-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 50%;
    margin-top: -25px;
    z-index: 10;
    white-space: nowrap;
}

.navbar.custom-header .navbar-brand.logo-end {
    margin-left: auto;
    margin-right: 0;
    order: 3;
}

/* Container adjustments for center logo */
.navbar.custom-header .container.has-center-logo {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 70px;
}

/* Split navigation for center logo */
.navbar.custom-header .container.has-center-logo .navbar-collapse {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.navbar.custom-header .container.has-center-logo .navbar-nav {
    display: flex;
    flex-direction: row;
    margin: 0;
    width: auto;
}

/* Left side navigation */
.navbar.custom-header .container.has-center-logo .navbar-nav.nav-left {
    justify-content: flex-start;
    margin-right: auto;
}

/* Right side navigation */
.navbar.custom-header .container.has-center-logo .navbar-nav.nav-right {
    justify-content: flex-end;
    margin-left: auto;
}

/* WhatsApp button positioning */
.navbar.custom-header .navbar-actions {
    margin-left: auto;
    order: 3;
}

/* WhatsApp button positioning */
.navbar.custom-header .navbar-actions {
    display: flex !important;
    align-items: center !important;
}

/* WhatsApp button for center logo */
.navbar.custom-header .navbar-actions.navbar-actions-center {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
}

/* Header icons group styling */
.header-icons-group {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
}

/* WhatsApp icon button styling - next to theme toggle */
.whatsapp-icon-btn-header {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    background: #25d366 !important;
    border: none !important;
    border-radius: 50% !important;
    color: white !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3) !important;
    font-size: 18px !important;
}

.whatsapp-icon-btn-header:hover {
    background: #128c7e !important;
    transform: translateY(-2px) scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.5) !important;
    color: white !important;
    text-decoration: none !important;
}

.whatsapp-icon-btn-header i {
    font-size: 20px !important;
}

/* Chatbot toggle styling to match WhatsApp icon */
.chatbot-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border: none !important;
    border-radius: 50% !important;
    color: white !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-size: 18px !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
}

.chatbot-toggle:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1) !important;
    transform: translateY(-2px) scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5) !important;
}

.chatbot-toggle i {
    font-size: 20px !important;
}

/* Mobile WhatsApp button */
.navbar.custom-header .mobile-whatsapp-btn {
    background: linear-gradient(135deg, #25d366, #128c7e) !important;
    border: none !important;
    border-radius: 25px !important;
    padding: 12px 20px !important;
    font-weight: 600 !important;
    margin-top: 15px !important;
    color: white !important;
}

/* Ensure proper spacing between elements */
.navbar.custom-header .container.has-center-logo .navbar-nav.nav-left {
    margin-right: 20px;
}

.navbar.custom-header .container.has-center-logo .navbar-nav.nav-right {
    margin-left: 20px;
}

/* Ensure navbar has enough height for center logo */
.navbar.custom-header.has-center-logo {
    min-height: 80px;
    padding-top: 15px;
    padding-bottom: 15px;
}

/* FORCE show navbar collapse on ALL screens by default */
#navbarNav {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
}

/* FORCE show all navbar elements */
.navbar-nav:not(.mobile-nav) {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
}

/* Mobile responsive adjustments */
@media (max-width: 991px) {
    /* Reset all logo positioning on mobile */
    .navbar.custom-header .navbar-brand.logo-center,
    .navbar.custom-header .navbar-brand.logo-end {
        position: static !important;
        transform: none !important;
        margin: 0 !important;
        order: 0 !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
    }

    /* Mobile container adjustments */
    .navbar.custom-header .container,
    .navbar.custom-header .container.has-center-logo {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        min-height: auto !important;
    }

    /* Mobile navbar collapse - FORCE CLOSED BY DEFAULT */
    .navbar.custom-header .navbar-collapse {
        display: none !important;
        flex-direction: column !important;
        width: 100% !important;
        margin-top: 15px !important;
        background: inherit !important;
        border-radius: 10px !important;
        padding: 15px !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
    }

    /* Only show when explicitly opened */
    .navbar.custom-header .navbar-collapse.show {
        display: block !important;
    }

    /* Mobile navigation lists */
    .navbar.custom-header .navbar-nav,
    .navbar.custom-header .navbar-nav.nav-left,
    .navbar.custom-header .navbar-nav.nav-right {
        flex-direction: column !important;
        width: 100% !important;
        text-align: center !important;
        margin: 0 !important;
        justify-content: center !important;
    }

    /* Mobile nav links */
    .navbar.custom-header .nav-link {
        padding: 12px 15px !important;
        border-radius: 8px !important;
        margin: 3px 0 !important;
        text-align: center !important;
    }

    .navbar.custom-header .nav-link:hover {
        background: rgba(0,0,0,0.1) !important;
    }

    /* Mobile navbar actions */
    .navbar.custom-header .navbar-actions,
    .navbar.custom-header .navbar-actions-center {
        position: static !important;
        transform: none !important;
        margin: 15px auto 0 auto !important;
        text-align: center !important;
        order: 4 !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }

    /* Mobile navbar height */
    .navbar.custom-header,
    .navbar.custom-header.has-center-logo {
        min-height: auto !important;
        padding: 10px 0 !important;
    }

    /* Mobile navbar toggler */
    .navbar.custom-header .navbar-toggler {
        border: none !important;
        padding: 4px 8px !important;
        order: 2 !important;
    }

    /* Mobile navbar brand */
    .navbar.custom-header .navbar-brand {
        order: 1 !important;
        margin-right: auto !important;
    }

    /* Mobile navigation specific styles */
    .navbar.custom-header .mobile-nav {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .navbar.custom-header .mobile-nav .nav-item {
        width: 100% !important;
        margin: 0 !important;
    }

    .navbar.custom-header .mobile-nav .nav-link {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        padding: 12px 20px !important;
        margin: 2px 0 !important;
        border-radius: 8px !important;
        transition: all 0.3s ease !important;
    }

    .navbar.custom-header .mobile-nav .nav-link:hover {
        background: rgba(255,255,255,0.1) !important;
        transform: translateX(-3px) !important;
    }

    .navbar.custom-header .mobile-nav .btn {
        margin: 10px 0 !important;
        padding: 12px 20px !important;
        border-radius: 25px !important;
    }

    /* Hide desktop navigation on mobile for ALL logo positions */
    .navbar.custom-header .nav-left,
    .navbar.custom-header .nav-right,
    .navbar.custom-header .navbar-nav:not(.mobile-nav) {
        display: none !important;
    }

    /* Show mobile nav only on mobile */
    .navbar.custom-header .mobile-nav {
        display: none;
    }

    .navbar.custom-header .navbar-collapse.show .mobile-nav {
        display: flex !important;
        flex-direction: column !important;
    }
}

    /* Ensure mobile menu is always visible when collapsed menu is shown */
    .navbar.custom-header .navbar-collapse.show .mobile-nav {
        display: flex !important;
    }

    /* Override desktop rule - hide on mobile by default */
    #navbarNav {
        display: none !important;
    }

    /* Show only when explicitly opened on mobile */
    #navbarNav.show {
        display: block !important;
    }

    #navbarNav.collapsing {
        display: block !important;
    }
}

/* Desktop navigation - show on large screens */
@media (min-width: 992px) {
    /* FORCE show desktop navigation */
    .navbar.custom-header .nav-left,
    .navbar.custom-header .nav-right,
    .navbar.custom-header .navbar-nav:not(.mobile-nav) {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        margin: 0 !important;
    }

    /* Hide mobile nav on desktop */
    .navbar.custom-header .mobile-nav {
        display: none !important;
    }

    /* FORCE show navbar collapse on desktop - OVERRIDE mobile rules */
    #navbarNav,
    #navbarNav:not(.show),
    #navbarNav.show {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Desktop navbar nav items alignment */
    .navbar.custom-header .navbar-nav {
        flex-direction: row !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .navbar.custom-header .navbar-nav .nav-item {
        margin: 0 3px !important;
        padding: 0 !important;
    }

    .navbar.custom-header .navbar-nav .nav-link {
        padding: 8px 12px !important;
        white-space: nowrap !important;
        display: flex !important;
        align-items: center !important;
    }

    /* Center logo desktop layout */
    .navbar.custom-header .container.has-center-logo .navbar-collapse {
        justify-content: space-between !important;
        align-items: center !important;
    }

    .navbar.custom-header .container.has-center-logo .nav-left {
        justify-content: flex-start !important;
        margin-right: auto !important;
        flex: 1 !important;
    }

    .navbar.custom-header .container.has-center-logo .nav-right {
        justify-content: flex-end !important;
        margin-left: auto !important;
        flex: 1 !important;
    }

    /* Normal layout for start/end logo */
    .navbar.custom-header .container:not(.has-center-logo) .navbar-nav {
        margin-right: auto !important;
    }
}

/* Additional color overrides */
.navbar.custom-header * {
    border-color: inherit;
}

.navbar.custom-header .navbar-toggler {
    border-color: rgba(255,255,255,0.3);
}

.navbar.custom-header .navbar-toggler:focus {
    box-shadow: none;
}

/* Responsive adjustments for logo positioning */
@media (max-width: 768px) {
    .navbar-brand.logo-center {
        position: static;
        transform: none;
        left: auto;
    }
    
    .navbar-brand.logo-end {
        margin-left: 0;
        margin-right: auto;
    }
}

/* Enhanced navbar styling */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.navbar-brand img {
    max-height: 50px;
    width: auto;
    transition: all 0.3s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

/* Theme toggle button styling */
.theme-toggle {
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    background: rgba(0,0,0,0.1);
}

.theme-toggle:hover {
    background: rgba(0,0,0,0.2);
    transform: scale(1.1);
}

/* WhatsApp button styling */
.btn-success {
    background: linear-gradient(135deg, #25d366, #128c7e);
    border: none;
    border-radius: 25px;
    padding: 8px 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background: linear-gradient(135deg, #128c7e, #075e54);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

/* Menu icons styling */
.navbar.custom-header .nav-link i {
    margin-left: 8px;
    font-size: 0.9em;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.navbar.custom-header .nav-link:hover i {
    opacity: 1;
    transform: scale(1.1);
}

/* Mobile navbar adjustments */
@media (max-width: 991px) {
    .navbar-collapse {
        background: inherit;
        margin-top: 10px;
        border-radius: 10px;
        padding: 15px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }

    .navbar-nav .nav-link {
        padding: 10px 15px;
        border-radius: 8px;
        margin: 2px 0;
    }

    .navbar-nav .nav-link:hover {
        background: rgba(0,0,0,0.1);
    }

    /* Adjust icon spacing on mobile */
    .navbar.custom-header .nav-link i {
        margin-left: 6px;
        font-size: 1em;
    }
}

/* Animation for navbar items */
.navbar-nav .nav-item {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.navbar-nav .nav-item:nth-child(1) { animation-delay: 0.1s; }
.navbar-nav .nav-item:nth-child(2) { animation-delay: 0.2s; }
.navbar-nav .nav-item:nth-child(3) { animation-delay: 0.3s; }
.navbar-nav .nav-item:nth-child(4) { animation-delay: 0.4s; }
.navbar-nav .nav-item:nth-child(5) { animation-delay: 0.5s; }
.navbar-nav .nav-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sticky navbar enhancement */
.navbar.sticky-top {
    backdrop-filter: blur(15px);
    background-color: rgba(255, 255, 255, 0.95) !important;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .navbar.sticky-top {
        background-color: rgba(33, 37, 41, 0.95) !important;
    }
}
