/* New Vision Professional Header Styles */

:root {
    /* New Vision Brand Colors */
    --brand-primary: #0d2d68;
    --brand-success: #11a976;
    --brand-info: #2473be;
    --brand-accent: #00e5fa;
    --brand-dark: #0a0a0c;
    
    /* Header Variables */
    --header-height: 80px;
    --header-bg: rgba(255, 255, 255, 0.8);
    --header-border: rgba(13, 45, 104, 0.08);
    --header-shadow: 0 4px 20px rgba(13, 45, 104, 0.08);
    --text-dark: var(--brand-dark);
    --text-muted: #6c757d;
    --primary-accent: var(--brand-primary);
    --secondary-accent: var(--brand-accent);
    --keya-adminbar: 0px;
}

body.admin-bar {
    --keya-adminbar: 32px;
}

@media (max-width: 782px) {
    body.admin-bar {
        --keya-adminbar: 46px;
    }
}

#site-header {
    background: var(--header-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--header-border);
    box-shadow: var(--header-shadow);
    height: var(--header-height);
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9999;
    transition: all 0.3s ease;

    /* Force block to neutralize theme's flex on .site-header */
    display: block !important;
    box-sizing: border-box;
}

/* Make header content span full width but keep content nicely centered */
#site-header .header-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* symmetric columns: left | NAV (center) | right */
    align-items: center;
    gap: 24px;
    width: 100%;
    height: 100%; /* Ensure container fills header height */
    max-width: 1200px; /* match page container */
    margin: 0 auto; /* center horizontally */
    padding-left: 20px;
    padding-right: 20px;
}

/* Place items within the grid */
#site-header .site-branding { justify-self: start; }
#site-header .site-navigation { justify-self: center; }
#site-header .header-actions { justify-self: end; }

/* Optional: keep nav items centered within their own block */
#site-header .site-navigation .menu { justify-content: center; }

/* On very wide screens, optionally expand a bit more */
@media (min-width: 1600px) {
    #site-header .header-container { max-width: 1320px; }
}

.site-branding .site-title a {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-dark);
    text-decoration: none;
}

.site-branding .custom-logo {
    max-height: 40px;
    width: auto;
}

.site-navigation .menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

.site-navigation .menu a {
    color: var(--brand-dark);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
    padding: 5px 0;
}

.site-navigation .menu a:hover {
    color: var(--brand-primary);
}

.site-navigation .menu a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--brand-primary);
    transition: width 0.3s ease;
}

.site-navigation .menu a:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-cta {
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-success));
    color: white;
    border: none;
    white-space: nowrap;
    display: inline-block;
}

.header-cta:hover {
    transform: translateY(-2px);
    background: linear-gradient(90deg, var(--brand-success), var(--brand-accent));
    box-shadow: 0 8px 15px rgba(13, 45, 104, 0.2);
}

#site-header a.header-cta,
#site-header .header-cta,
#site-header .btn.header-cta,
#site-header .btn.btn-primary.header-cta {
    background-color: var(--primary-accent); /* fallback */
    background: linear-gradient(90deg, var(--primary-accent), var(--secondary-accent));
    color: #ffffff;
    border: none;
}

#site-header a.header-cta:visited { color: #ffffff; }
#site-header a.header-cta:hover,
#site-header .header-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 82, 212, 0.2);
    color: #ffffff;
}
#site-header a.header-cta:focus,
#site-header .header-cta:focus { outline: 2px solid rgba(101, 199, 247, 0.5); outline-offset: 2px; }
#site-header a.header-cta:active,
#site-header .header-cta:active { transform: translateY(0); }

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--primary-accent); /* Use brand color */
    border-radius: 4px; /* Add some rounding */
    transition: background-color 0.3s ease;
    background: none; /* ensure no theme background leaks */
}

/* Ensure no external styles set a pink background */
#site-header .header-actions .mobile-menu-toggle,
#site-header .mobile-menu-toggle {
    background-color: transparent !important;
    color: var(--primary-accent) !important;
}

/* Active state when menu is open */
body.mobile-menu-active #site-header .mobile-menu-toggle {
    background-color: rgba(0, 82, 212, 0.12) !important;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle.is-active {
    background-color: rgba(0, 82, 212, 0.1); /* Light primary accent background on hover */
}

.mobile-menu-toggle .lucide {
    width: 28px;
    height: 28px;
}

.mobile-navigation {
    position: fixed;
    top: 0; /* Start from top */
    left: 0;
    width: 100%;
    height: 100vh; /* Full viewport height */
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 99999; /* Highest z-index */
    padding: 100px 40px 40px; /* Add top padding for close button */
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mobile-navigation.is-open {
    transform: translateX(0);
}

body.admin-bar header#site-header {
    top: var(--wp-admin--admin-bar--height, var(--keya-adminbar)) !important;
}

/* Keep mobile drawer aligned with header + admin bar (single rule, no media duplicate) */
body.admin-bar .mobile-navigation {
    top: calc(var(--header-height) + var(--wp-admin--admin-bar--height, var(--keya-adminbar)));
    height: calc(100vh - var(--header-height) - var(--wp-admin--admin-bar--height, var(--keya-adminbar)));
}

@media screen and (max-width: 992px) {
    #site-header .header-container {
        display: flex;
        justify-content: space-between;
    }

    .site-navigation, .header-actions .header-cta {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }
}

.mobile-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 30px; /* Increased gap */
    text-align: center;
    width: 100%;
}

.mobile-menu a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 2rem; /* Larger font */
    font-weight: 700;
    padding: 10px;
    display: block;
    transition: color 0.3s, transform 0.3s;
}

.mobile-menu a:hover {
    color: var(--primary-accent) !important; /* Use brand color, ensure it overrides other styles */
    transform: scale(1.1);
}

.mobile-menu .btn {
    margin-top: 30px;
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(90deg, var(--primary-accent), var(--secondary-accent));
    color: white;
    border-radius: 50px;
    font-size: 1.2rem;
    white-space: nowrap;
}

/* Close button for mobile menu */
.mobile-menu-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s, color 0.3s;
}

.mobile-menu-close:hover {
    background-color: rgba(0, 0, 0, 0.08);
    color: var(--primary-accent);
}

.mobile-menu-close .lucide {
    width: 32px;
    height: 32px;
}

html {
    scroll-padding-top: calc(var(--header-height) + var(--wp-admin--admin-bar--height, 0px));
}

/* ====================================
   Modern Language Toggle - AR/EN Circle
   ==================================== */

.lang-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.lang-toggle:focus {
    outline: none;
}

.lang-toggle:focus-visible .lang-toggle-circle {
    outline: 2px solid var(--brand-accent);
    outline-offset: 3px;
}

/* The Circle Container */
.lang-toggle-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e1e8f0;
    box-shadow: 
        0 2px 8px rgba(0, 82, 212, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Gradient overlay that appears on hover */
.lang-toggle-circle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Language Code Text (AR/EN) */
.lang-code {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #0b2540;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
}

/* Hover Effects */
.lang-toggle:hover .lang-toggle-circle {
    transform: translateY(-2px) scale(1.05);
    border-color: var(--brand-accent);
    box-shadow: 
        0 8px 20px rgba(0, 82, 212, 0.15),
        0 3px 8px rgba(101, 199, 247, 0.1);
}

.lang-toggle:hover .lang-toggle-circle::before {
    opacity: 1;
}

.lang-toggle:hover .lang-code {
    color: #ffffff;
    transform: scale(1.05);
}

/* Active/Pressed State */
.lang-toggle:active .lang-toggle-circle {
    transform: translateY(0) scale(0.98);
    box-shadow: 
        0 2px 6px rgba(0, 82, 212, 0.12),
        0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Pulse animation on page load */
@keyframes pulse-lang {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.lang-toggle-circle {
    animation: pulse-lang 2s ease-in-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lang-toggle-circle {
        width: 42px;
        height: 42px;
    }
    
    .lang-code {
        font-size: 13px;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .lang-toggle-circle {
        background: linear-gradient(135deg, #1a1a2e 0%, #2a2a3e 100%);
        border-color: #3a3a4e;
    }
    
    .lang-code {
        color: #e8e8f0;
    }
    
    .lang-toggle:hover .lang-code {
        color: #ffffff;
    }
}
