/* ===================================
   Ultra Modern Header Design 2024
   Glassmorphism & Modern UI
   =================================== */

/* Header wrapper - Glassmorphism effect */
.hdWrp {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(45, 95, 63, 0.08);
}

.hdWrp.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    border-bottom-color: rgba(45, 95, 63, 0.12);
}

#hdC {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

.hdCBks {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    gap: 40px;
}

/* Logo Section - Modern Card Style */
.header-logo {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.header-logo .widget {
    display: flex;
    align-items: center;
    gap: 0;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 4px;
    border-radius: 12px;
}

.logo-link:hover {
    transform: translateY(-2px);
}

.logo-container {
    flex-shrink: 0;
}

.logo-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(45, 95, 63, 0.2));
    transition: all 0.3s ease;
}

.logo-link:hover .logo-img {
    filter: drop-shadow(0 4px 12px rgba(45, 95, 63, 0.3));
    transform: scale(1.05);
}

.titleHdn {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.titleHdn h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.titleHdn h1 a {
    color: #1a1a1a;
    text-decoration: none;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #2d5f3f 0%, #1a4d2e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.logo-link:hover .titleHdn h1 a {
    transform: translateX(2px);
}

.titleHdn .subtitle {
    margin: 0;
    font-size: 11px;
    color: #666;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.8;
}

/* Navigation Menu - Modern Pills */
.header-menu {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 800px;
}

.flex-menu {
    width: 100%;
}

.menu-wrapper {
    width: 100%;
}

.menu {
    display: flex;
    justify-content: center;
}

.main-menu {
    display: flex;
    justify-content: center;
    width: 100%;
}

#main-menu-nav {
    display: flex;
    gap: 6px;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
}

#main-menu-nav > li {
    position: relative;
}

/* Menu styling - Let menu-dropdown.css handle main menu items */
/* This ensures dropdown functionality is preserved */
#main-menu-nav > li > a {
    /* Base styles - will be enhanced by menu-dropdown.css */
    position: relative;
}

/* Ensure submenu positioning works correctly */
#main-menu-nav > li.has-submenu {
    position: relative;
}

/* Submenu container styling - ensure it's visible */
.submenu {
    z-index: 1001 !important;
}

/* Header Actions - Modern Buttons */
.hdRight {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Search Button - Modern Glass */
#sICN {
    display: flex;
    align-items: center;
}

.search-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.search-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(45, 95, 63, 0.2) 0%, rgba(26, 77, 46, 0.15) 100%);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.search-btn:hover::before {
    width: 100%;
    height: 100%;
}

.search-btn:hover {
    background: rgba(45, 95, 63, 0.1);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(45, 95, 63, 0.2);
}

.search-icon {
    width: 20px;
    height: 20px;
    fill: #333;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.search-btn:hover .search-icon {
    fill: #2d5f3f;
    transform: scale(1.1);
}

/* Theme Toggle - Modern Switch */
.dm {
    display: flex;
    align-items: center;
    gap: 12px;
}

.switch {
    position: relative;
    width: 56px;
    height: 30px;
    background: rgba(220, 220, 220, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox {
    display: none;
}

.checkbox:checked + .switch {
    background: linear-gradient(135deg, #2d5f3f 0%, #1a4d2e 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(45, 95, 63, 0.1);
}

.checkbox:checked + .switch .slider {
    transform: translateX(26px);
    box-shadow: 0 2px 12px rgba(45, 95, 63, 0.4);
}

.sun, .moon {
    display: none;
}

/* Mobile Menu Toggle */
.menushow {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.menushow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(45, 95, 63, 0.2) 0%, rgba(26, 77, 46, 0.15) 100%);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.menushow:hover::before {
    width: 100%;
    height: 100%;
}

.menushow:hover {
    background: rgba(45, 95, 63, 0.1);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(45, 95, 63, 0.2);
}

.menu-icon {
    width: 22px;
    height: 22px;
    fill: #333;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.menushow:hover .menu-icon {
    fill: #2d5f3f;
}

.menuhide {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1001;
}

.menuhide:hover {
    background: rgba(255, 255, 255, 1);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.close-icon {
    width: 20px;
    height: 20px;
    fill: #333;
    transition: fill 0.3s ease;
}

.menuhide:hover .close-icon {
    fill: #e74c3c;
}

/* Overlay for mobile menu */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.active {
    opacity: 1;
}

/* Dropdown Arrow */
.dropdown-arrow {
    font-size: 0.65em;
    margin-left: 6px;
    transition: transform 0.3s ease;
    display: inline-block;
}

.has-submenu:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Responsive Design */
@media (max-width: 1024px) {
    #hdC {
        padding: 0 20px;
    }
    
    .hdCBks {
        padding: 16px 0;
        gap: 30px;
    }
    
    .header-menu .main-menu {
        display: none;
    }
    
    .menushow {
        display: flex;
    }
}

@media (max-width: 768px) {
    .hdCBks {
        padding: 14px 0;
        gap: 20px;
    }
    
    #hdC {
        padding: 0 16px;
    }
    
    .logo-container {
        width: 56px;
        height: 56px;
    }
    
    .titleHdn h1 {
        font-size: 18px;
    }
    
    .titleHdn .subtitle {
        font-size: 10px;
        letter-spacing: 1px;
    }
    
    .header-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(30px) saturate(200%);
        -webkit-backdrop-filter: blur(30px) saturate(200%);
        z-index: 999;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 40px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
    }
    
    .header-menu.active {
        left: 0;
    }
    
    .menu-wrapper {
        height: 100%;
    }
    
    .menu {
        flex-direction: column;
        padding: 80px 24px 24px;
        height: 100%;
    }
    
    .main-menu {
        display: flex;
        width: 100%;
    }
    
    #main-menu-nav {
        flex-direction: column;
        width: 100%;
        gap: 8px;
        align-items: stretch;
    }
    
    #main-menu-nav > li {
        width: 100%;
    }
    
    #main-menu-nav > li > a {
        width: 100%;
        justify-content: flex-start;
        padding: 14px 20px;
        border-radius: 12px;
    }
    
    .menuhide {
        display: flex;
    }
    
    .overlay.active {
        display: block;
    }
    
    .search-btn,
    .menushow {
        width: 40px;
        height: 40px;
    }
    
    .switch {
        width: 50px;
        height: 28px;
    }
    
    .slider {
        width: 22px;
        height: 22px;
    }
    
    .checkbox:checked + .switch .slider {
        transform: translateX(22px);
    }
}

@media (max-width: 480px) {
    .logo-container {
        width: 48px;
        height: 48px;
    }
    
    .titleHdn h1 {
        font-size: 16px;
    }
    
    .titleHdn .subtitle {
        font-size: 9px;
    }
    
    .hdRight {
        gap: 8px;
    }
}

/* Dark Mode Styles */
body.dark-mode .hdWrp {
    background: rgba(26, 26, 26, 0.8);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .hdWrp.scrolled {
    background: rgba(26, 26, 26, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.15);
}

body.dark-mode .logo-container {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.15) 0%, rgba(34, 197, 94, 0.1) 100%);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.2);
}

body.dark-mode .logo-link:hover .logo-container {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.25) 0%, rgba(34, 197, 94, 0.15) 100%);
    box-shadow: 0 6px 20px rgba(74, 222, 128, 0.3);
}

body.dark-mode .titleHdn h1 a {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark-mode .titleHdn .subtitle {
    color: #999;
}

body.dark-mode #main-menu-nav > li > a {
    color: #e0e0e0;
}

body.dark-mode #main-menu-nav > li > a::before {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.15) 0%, rgba(34, 197, 94, 0.1) 100%);
}

body.dark-mode #main-menu-nav > li > a:hover {
    color: #4ade80;
}

body.dark-mode #main-menu-nav > li.active > a {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: #1a1a1a;
    box-shadow: 0 4px 16px rgba(74, 222, 128, 0.4);
}

body.dark-mode .search-btn,
body.dark-mode .menushow {
    background: rgba(42, 42, 42, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .search-btn:hover,
body.dark-mode .menushow:hover {
    background: rgba(74, 222, 128, 0.15);
    box-shadow: 0 6px 20px rgba(74, 222, 128, 0.3);
}

body.dark-mode .search-icon,
body.dark-mode .menu-icon {
    fill: #e0e0e0;
}

body.dark-mode .search-btn:hover .search-icon,
body.dark-mode .menushow:hover .menu-icon {
    fill: #4ade80;
}

body.dark-mode .switch {
    background: rgba(60, 60, 60, 0.8);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-mode .checkbox:checked + .switch {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(74, 222, 128, 0.2);
}

@media (max-width: 768px) {
    body.dark-mode .header-menu {
        background: rgba(26, 26, 26, 0.98);
    }
    
    body.dark-mode .menuhide {
        background: rgba(42, 42, 42, 0.9);
    }
    
    body.dark-mode .close-icon {
        fill: #e0e0e0;
    }
    
    body.dark-mode .menuhide:hover {
        background: rgba(60, 60, 60, 1);
    }
}

/* Smooth scroll behavior */
@supports (scroll-behavior: smooth) {
    html {
        scroll-behavior: smooth;
    }
}

/* Animation for header on load */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hdWrp {
    animation: fadeInDown 0.6s ease-out;
}
