/*
 * REVIEWSENSEI - Unified Header System
 * Comprehensive header solution fixing all overlapping and alignment issues
 * Version: 2.0
 * Author: Claude Code Assistant
 */

/* ========================================
   RESET & BASE STRUCTURE
   ======================================== */

/* Reset any conflicting header styles */
.axil-header,
.axil-header * {
    box-sizing: border-box;
}

/* Main header container */
.axil-header {
    height: 80px !important;
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
    z-index: 1000;
    padding: 0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Header wrapper */
.axil-header .header-wrap {
    height: 80px !important;
    padding: 0 20px !important;
    margin: 0 !important;
}

/* Main row container */
.axil-header .header-wrap .row {
    height: 80px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

/* ========================================
   LOGO SECTION - Perfect Alignment
   ======================================== */

.axil-header .logo {
    height: 80px !important;
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}

.axil-header .logo a {
    display: inline-block !important;
    line-height: 1 !important;
}

.axil-header .logo img {
    height: 42px !important;
    width: auto !important;
    vertical-align: middle !important;
    max-height: 42px !important;
}

/* ========================================
   MAIN NAVIGATION - Perfect Centering
   ======================================== */

.axil-header .mainmenu-wrapper {
    height: 80px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-grow: 1 !important;
    margin: 0 20px !important;
}

.axil-header .mainmenu-nav {
    height: 80px !important;
    display: flex !important;
    align-items: center !important;
}

.axil-header .mainmenu-nav ul.mainmenu {
    display: flex !important;
    align-items: center !important;
    height: 80px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    justify-content: center !important;
}

.axil-header .mainmenu-nav ul.mainmenu > li {
    position: relative !important;
    height: 80px !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 15px !important;
}

.axil-header .mainmenu-nav ul.mainmenu > li > a {
    display: flex !important;
    align-items: center !important;
    height: 80px !important;
    padding: 0 !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    color: #333333 !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.axil-header .mainmenu-nav ul.mainmenu > li > a:hover {
    color: #3858f6 !important;
}

/* Submenu styling */
.axil-header .mainmenu-nav ul.mainmenu > li.menu-item-has-children .axil-submenu {
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: #ffffff !important;
    min-width: 220px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
    border-radius: 8px !important;
    padding: 15px 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s ease !important;
    z-index: 1001 !important;
    border: 1px solid #e5e5e5 !important;
}

.axil-header .mainmenu-nav ul.mainmenu > li.menu-item-has-children:hover .axil-submenu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(5px) !important;
}

.axil-header .mainmenu-nav ul.mainmenu > li.menu-item-has-children .axil-submenu li {
    display: block !important;
    height: auto !important;
    margin: 0 !important;
}

.axil-header .mainmenu-nav ul.mainmenu > li.menu-item-has-children .axil-submenu li a {
    display: block !important;
    height: auto !important;
    padding: 12px 25px !important;
    font-size: 14px !important;
    color: #666666 !important;
    line-height: 1.4 !important;
    border-bottom: 1px solid #f5f5f5 !important;
    transition: all 0.3s ease !important;
}

.axil-header .mainmenu-nav ul.mainmenu > li.menu-item-has-children .axil-submenu li:last-child a {
    border-bottom: none !important;
}

.axil-header .mainmenu-nav ul.mainmenu > li.menu-item-has-children .axil-submenu li a:hover {
    background-color: #f8f9fa !important;
    color: #3858f6 !important;
    padding-left: 30px !important;
}

/* ========================================
   SEARCH & USER AREA - Perfect Right Alignment
   ======================================== */

.axil-header .header-search {
    height: 80px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 15px !important;
    flex-shrink: 0 !important;
}

/* Desktop search form */
.axil-header .header-search .header-search-form {
    height: 45px !important;
    width: 300px !important;
    position: relative !important;
    flex-shrink: 0 !important;
}

.axil-header .header-search .header-search-form .axil-search.form-group {
    height: 45px !important;
    position: relative !important;
    margin: 0 !important;
    background: #f8f9fa !important;
    border: 2px solid transparent !important;
    border-radius: 25px !important;
    transition: all 0.3s ease !important;
    overflow: hidden !important;
}

.axil-header .header-search .header-search-form .axil-search.form-group:focus-within {
    border-color: #3858f6 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(56, 88, 246, 0.1) !important;
}

.axil-header .header-search .header-search-form .axil-search.form-group input {
    width: 100% !important;
    height: 41px !important;
    padding: 0 55px 0 20px !important;
    border: none !important;
    background: transparent !important;
    font-size: 14px !important;
    color: #333333 !important;
    outline: none !important;
    border-radius: 25px !important;
    min-width: auto !important;
}

.axil-header .header-search .header-search-form .axil-search.form-group input::placeholder {
    color: #999999 !important;
}

.axil-header .header-search .header-search-form .axil-search.form-group .search-button {
    position: absolute !important;
    right: 3px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 39px !important;
    height: 39px !important;
    border: none !important;
    background: #3858f6 !important;
    color: #ffffff !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    z-index: 2 !important;
}

.axil-header .header-search .header-search-form .axil-search.form-group .search-button:hover {
    background: #2c46d4 !important;
    transform: translateY(-50%) scale(1.05) !important;
}

.axil-header .header-search .header-search-form .axil-search.form-group .search-button i {
    font-size: 14px !important;
    line-height: 1 !important;
}

/* User metadata bar */
.axil-header .header-search .metabar-block {
    display: flex !important;
    align-items: center !important;
    height: 80px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
}

.axil-header .header-search .metabar-block li {
    height: 45px !important;
    width: 45px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
}

.axil-header .header-search .metabar-block li.icon a {
    width: 45px !important;
    height: 45px !important;
    background: #f8f9fa !important;
    color: #666666 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

.axil-header .header-search .metabar-block li.icon a:hover {
    background: #3858f6 !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
}

.axil-header .header-search .metabar-block li.icon a i {
    font-size: 16px !important;
    line-height: 1 !important;
}

/* Avatar styling */
.axil-header .header-search .metabar-block li:last-child a img {
    width: 45px !important;
    height: 45px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid #f0f0f0 !important;
    transition: all 0.3s ease !important;
}

.axil-header .header-search .metabar-block li:last-child a:hover img {
    border-color: #3858f6 !important;
    transform: translateY(-2px) !important;
}

/* ========================================
   HAMBURGER MENU - Mobile Perfect
   ======================================== */

.axil-header .header-search .hamburger-menu {
    height: 80px !important;
    display: flex !important;
    align-items: center !important;
    margin-left: 15px !important;
    flex-shrink: 0 !important;
}

.axil-header .header-search .hamburger-menu .hamburger-inner {
    width: 45px !important;
    height: 45px !important;
    background: #f8f9fa !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    color: #666666 !important;
}

.axil-header .header-search .hamburger-menu .hamburger-inner:hover {
    background: #3858f6 !important;
    color: #ffffff !important;
}

.axil-header .header-search .hamburger-menu .hamburger-inner .icon i {
    font-size: 18px !important;
    line-height: 1 !important;
}

/* ========================================
   MOBILE SEARCH FUNCTIONALITY
   ======================================== */

.axil-header .header-search .mobile-search-wrapper {
    position: relative !important;
}

.axil-header .header-search .mobile-search-wrapper .search-button-toggle {
    width: 45px !important;
    height: 45px !important;
    background: #f8f9fa !important;
    color: #666666 !important;
    border: none !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.axil-header .header-search .mobile-search-wrapper .search-button-toggle:hover {
    background: #3858f6 !important;
    color: #ffffff !important;
}

.axil-header .header-search .mobile-search-wrapper .search-button-toggle i {
    font-size: 16px !important;
    line-height: 1 !important;
}

.axil-header .header-search .mobile-search-wrapper .header-search-form {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    width: 280px !important;
    background: #ffffff !important;
    padding: 20px !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15) !important;
    border-radius: 0 0 15px 15px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s ease !important;
    z-index: 1002 !important;
    border: 1px solid #e5e5e5 !important;
    border-top: none !important;
}

.axil-header .header-search .mobile-search-wrapper .header-search-form.open {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.axil-header .header-search .mobile-search-wrapper .header-search-form .form-group {
    width: 100% !important;
    margin: 0 !important;
}

.axil-header .header-search .mobile-search-wrapper .header-search-form .form-group .form-control {
    width: 100% !important;
    height: 45px !important;
    padding: 0 50px 0 15px !important;
    border: 2px solid #e5e5e5 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    outline: none !important;
}

.axil-header .header-search .mobile-search-wrapper .header-search-form .form-group .form-control:focus {
    border-color: #3858f6 !important;
    box-shadow: 0 0 0 3px rgba(56, 88, 246, 0.1) !important;
}

.axil-header .header-search .mobile-search-wrapper .header-search-form .form-group .search-button {
    position: absolute !important;
    right: 5px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 35px !important;
    height: 35px !important;
    background: #3858f6 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Large screens - optimal spacing */
@media (min-width: 1200px) {
    .axil-header .header-wrap {
        padding: 0 40px !important;
    }
    
    .axil-header .mainmenu-nav ul.mainmenu > li {
        margin: 0 20px !important;
    }
    
    .axil-header .header-search .header-search-form {
        width: 320px !important;
    }
}

/* Medium screens - hide navigation, show hamburger */
@media (max-width: 1199px) {
    .axil-header .mainmenu-wrapper {
        display: none !important;
    }
    
    .axil-header .header-wrap .row {
        justify-content: space-between !important;
    }
    
    .axil-header .header-search {
        flex-grow: 1 !important;
        justify-content: flex-end !important;
    }
    
    .axil-header .header-search .header-search-form {
        width: 250px !important;
    }
}

/* Tablet screens */
@media (max-width: 991px) {
    .axil-header .header-search .header-search-form {
        width: 220px !important;
    }
    
    .axil-header .header-search .metabar-block {
        gap: 10px !important;
    }
}

/* Small tablet screens */
@media (max-width: 767px) {
    .axil-header {
        height: 70px !important;
    }
    
    .axil-header .header-wrap,
    .axil-header .header-wrap .row,
    .axil-header .logo,
    .axil-header .header-search,
    .axil-header .header-search .metabar-block,
    .axil-header .header-search .hamburger-menu {
        height: 70px !important;
    }
    
    .axil-header .header-wrap {
        padding: 0 15px !important;
    }
    
    .axil-header .logo img {
        height: 35px !important;
        max-height: 35px !important;
    }
    
    .axil-header .header-search .header-search-form {
        display: none !important;
    }
    
    .axil-header .header-search .metabar-block {
        gap: 8px !important;
    }
    
    .axil-header .header-search .metabar-block li,
    .axil-header .header-search .metabar-block li.icon a,
    .axil-header .header-search .metabar-block li:last-child a img,
    .axil-header .header-search .hamburger-menu .hamburger-inner,
    .axil-header .header-search .mobile-search-wrapper .search-button-toggle {
        width: 40px !important;
        height: 40px !important;
    }
    
    .axil-header .header-search .mobile-search-wrapper .header-search-form {
        width: 260px !important;
    }
}

/* Extra small screens - minimal elements */
@media (max-width: 575px) {
    .axil-header .header-search .metabar-block li.icon {
        display: none !important;
    }
    
    .axil-header .header-search .mobile-search-wrapper .header-search-form {
        right: -10px !important;
        width: 240px !important;
    }
    
    .axil-header .header-wrap {
        padding: 0 10px !important;
    }
}

/* ========================================
   STICKY HEADER BEHAVIOR
   ======================================== */

.axil-header.header-sticky {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    transition: all 0.3s ease !important;
}

.axil-header.header-sticky.sticky-active {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */

.dark-mode .axil-header,
.axil-header.header-dark {
    background: #1a1a1a !important;
    border-color: #333333 !important;
}

.dark-mode .axil-header .mainmenu-nav ul.mainmenu > li > a,
.axil-header.header-dark .mainmenu-nav ul.mainmenu > li > a {
    color: #ffffff !important;
}

.dark-mode .axil-header .header-search .header-search-form .axil-search.form-group,
.axil-header.header-dark .header-search .header-search-form .axil-search.form-group {
    background: #2a2a2a !important;
}

.dark-mode .axil-header .header-search .header-search-form .axil-search.form-group input,
.axil-header.header-dark .header-search .header-search-form .axil-search.form-group input {
    color: #ffffff !important;
}

.dark-mode .axil-header .header-search .metabar-block li.icon a,
.axil-header.header-dark .header-search .metabar-block li.icon a {
    background: #2a2a2a !important;
    color: #ffffff !important;
}

.dark-mode .axil-header .header-search .hamburger-menu .hamburger-inner,
.axil-header.header-dark .header-search .hamburger-menu .hamburger-inner {
    background: #2a2a2a !important;
    color: #ffffff !important;
}

/* ========================================
   ACCESSIBILITY & FOCUS STATES
   ======================================== */

.axil-header a:focus,
.axil-header button:focus,
.axil-header input:focus {
    outline: 2px solid #3858f6 !important;
    outline-offset: 2px !important;
}

.axil-header a:focus:not(:focus-visible),
.axil-header button:focus:not(:focus-visible),
.axil-header input:focus:not(:focus-visible) {
    outline: none !important;
}

/* ========================================
   LOADING STATES
   ======================================== */

.axil-header.loading * {
    pointer-events: none !important;
    opacity: 0.7 !important;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .axil-header {
        display: none !important;
    }
}

/* ========================================
   OVERRIDE CONFLICTS - HIGHEST PRIORITY
   ======================================== */

/* Force override any existing conflicting styles */
.axil-header.axil-header.axil-header {
    height: 80px !important;
    padding: 0 !important;
}

.axil-header.axil-header.axil-header .header-wrap {
    height: 80px !important;
    padding: 0 20px !important;
}

.axil-header.axil-header.axil-header .header-wrap .row {
    height: 80px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

/* Ensure no other CSS can override these critical styles */
.axil-header .logo,
.axil-header .mainmenu-wrapper,
.axil-header .header-search {
    height: 80px !important;
    display: flex !important;
    align-items: center !important;
}

@media (max-width: 767px) {
    .axil-header.axil-header.axil-header {
        height: 70px !important;
    }
    
    .axil-header.axil-header.axil-header .header-wrap,
    .axil-header.axil-header.axil-header .header-wrap .row,
    .axil-header.axil-header.axil-header .logo,
    .axil-header.axil-header.axil-header .mainmenu-wrapper,
    .axil-header.axil-header.axil-header .header-search {
        height: 70px !important;
    }
}