/*
 * REVIEWSENSEI - Clean Header Styles
 * Completely rebuilt header with proper structure
 * Version: 1.0 - Clean Build
 * Author: Claude Code Assistant
 */

/* ========================================
   HEADER CONTAINER
   ======================================== */

.axil-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
    z-index: 999;
}

.axil-header.header-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-wrap {
    padding: 15px 0;
}

.header-wrap .row {
    align-items: center;
}

/* ========================================
   LOGO SECTION
   ======================================== */

.logo img {
    height: 45px;
    width: auto;
    transition: all 0.3s ease;
}

.logo img:hover {
    opacity: 0.8;
}

/* ========================================
   MAIN NAVIGATION
   ======================================== */

.mainmenu-wrapper {
    display: flex;
    justify-content: center;
}

.mainmenu {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 35px;
}

.mainmenu > li > a {
    color: #333333;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
}

.mainmenu > li > a:hover {
    color: #3858f6;
}

/* Submenu */
.menu-item-has-children {
    position: relative;
}

.axil-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 200px;
    padding: 15px 0;
    margin-top: 15px;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    border: 1px solid #e5e5e5;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    list-style: none;
}

.menu-item-has-children:hover .axil-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.axil-submenu li {
    padding: 0;
}

.axil-submenu li a {
    display: block;
    padding: 8px 20px;
    color: #666666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.axil-submenu li a:hover {
    color: #3858f6;
    background: #f8f9fa;
}

/* ========================================
   SEARCH AREA
   ======================================== */

.header-search-area {
    gap: 15px;
}

/* Desktop Search */
.header-search-desktop {
    position: relative;
}

.search-form {
    position: relative;
}

.search-input-group {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 25px;
    height: 45px;
    transition: all 0.3s ease;
    overflow: hidden;
}

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

.search-input {
    flex: 1;
    width: 220px;
    height: 100%;
    padding: 0 15px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #333333;
    outline: none;
    border-radius: 25px 0 0 25px;
}

.search-input::placeholder {
    color: #999999;
}

.search-btn {
    flex-shrink: 0;
    width: 45px;
    height: 100%;
    background: #3858f6;
    color: #ffffff;
    border: none;
    border-radius: 0 23px 23px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
}

.search-btn:hover {
    background: #2c46d4;
}

.search-btn i {
    font-size: 14px;
    line-height: 1;
}

/* Mobile Search */
.mobile-search-toggle {
    position: relative;
}

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

.mobile-search-btn:hover {
    background: #3858f6;
    color: #ffffff;
}

.mobile-search-btn i {
    font-size: 16px;
    line-height: 1;
}

.mobile-search-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 300px;
    max-width: calc(100vw - 30px);
    background: #ffffff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid #e5e5e5;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.mobile-search-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-search-dropdown::before {
    content: "";
    position: absolute;
    top: -8px;
    right: 15px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #ffffff;
    z-index: 1002;
}

.mobile-search-dropdown::after {
    content: "";
    position: absolute;
    top: -9px;
    right: 15px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #e5e5e5;
    z-index: 1001;
}

.mobile-search-input-group {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: #f8f9fa;
    border: 2px solid #e5e5e5;
    border-radius: 25px;
    height: 45px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.mobile-search-input-group:focus-within {
    border-color: #3858f6;
    box-shadow: 0 0 0 3px rgba(56, 88, 246, 0.1);
}

.mobile-search-input {
    flex: 1;
    height: 100%;
    padding: 0 15px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #333333;
    outline: none;
    border-radius: 25px 0 0 25px;
}

.mobile-search-input::placeholder {
    color: #999999;
}

.mobile-search-submit {
    flex-shrink: 0;
    width: 45px;
    height: 100%;
    background: #3858f6;
    color: #ffffff;
    border: none;
    border-radius: 0 23px 23px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
}

.mobile-search-submit:hover {
    background: #2c46d4;
}

.mobile-search-submit i {
    font-size: 14px;
    line-height: 1;
}

/* ========================================
   HAMBURGER MENU
   ======================================== */

.hamburger-menu {
    margin-left: 15px;
}

.hamburger-btn {
    width: 45px;
    height: 45px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: #333333;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.hamburger-btn:hover .hamburger-line {
    background: #3858f6;
}

/* Active state */
.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1199px) {
    .mainmenu-wrapper {
        display: none;
    }
    
    .header-wrap .row {
        justify-content: space-between;
    }
    
    .search-input {
        width: 180px;
    }
    
    .search-btn {
        width: 40px;
    }
}

@media (max-width: 991px) {
    .search-input {
        width: 160px;
    }
    
    .search-btn {
        width: 40px;
    }
}

@media (max-width: 768px) {
    .search-input-group {
        height: 42px;
    }
    
    .search-input {
        width: 140px;
        font-size: 13px;
    }
    
    .search-btn {
        width: 38px;
    }
    
    .search-btn i {
        font-size: 13px;
    }
}

@media (max-width: 767px) {
    .header-wrap {
        padding: 12px 0;
    }
    
    .logo img {
        height: 40px;
    }
    
    .header-search-desktop {
        display: none !important;
    }
    
    .mobile-search-toggle {
        display: block !important;
    }
    
    .mobile-search-dropdown {
        width: 280px;
    }
    
    .hamburger-menu {
        margin-left: 10px;
    }
    
    .hamburger-btn {
        width: 40px;
        height: 40px;
    }
    
    .hamburger-line {
        width: 18px;
    }
}

@media (max-width: 575px) {
    .logo img {
        height: 35px;
    }
    
    .mobile-search-dropdown {
        width: 260px;
        right: -10px;
    }
    
    .hamburger-btn {
        width: 36px;
        height: 36px;
    }
    
    .hamburger-line {
        width: 16px;
    }
}

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

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

.dark-mode .mainmenu > li > a {
    color: #ffffff;
}

.dark-mode .search-input-group,
.dark-mode .mobile-search-input-group {
    background: #2a2a2a;
    border-color: #404040;
}

.dark-mode .search-input,
.dark-mode .mobile-search-input {
    color: #ffffff;
}

.dark-mode .search-input::placeholder,
.dark-mode .mobile-search-input::placeholder {
    color: #999999;
}

.dark-mode .mobile-search-btn {
    background: #2a2a2a;
    color: #ffffff;
}

.dark-mode .mobile-search-dropdown {
    background: #1a1a1a;
    border-color: #333333;
}

.dark-mode .hamburger-line {
    background: #ffffff;
}

/* ========================================
   FOCUS AND ACCESSIBILITY
   ======================================== */

.search-input:focus,
.mobile-search-input:focus {
    outline: none;
}

.search-btn:focus,
.mobile-search-submit:focus,
.mobile-search-btn:focus,
.hamburger-btn:focus {
    outline: 2px solid #3858f6;
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ========================================
   UTILITY CLASSES & FIXES
   ======================================== */

/* Additional flex alignment fixes */
.search-input-group *,
.mobile-search-input-group * {
    vertical-align: top;
}

/* Ensure buttons don't shrink on small screens */
.search-btn,
.mobile-search-submit {
    min-width: 40px;
}

/* Fix for potential text selection issues */
.search-btn,
.mobile-search-submit,
.mobile-search-btn,
.hamburger-btn {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Loading state styles */
.search-btn.loading,
.mobile-search-submit.loading {
    opacity: 0.7;
    cursor: wait;
}

.search-btn.loading i,
.mobile-search-submit.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Form validation styles */
.search-input:invalid,
.mobile-search-input:invalid {
    border-color: #dc3545;
}

.search-input-group:has(.search-input:invalid),
.mobile-search-input-group:has(.mobile-search-input:invalid) {
    border-color: #dc3545;
}