/* KeyaTech Professional Header Styles */

:root {
    --header-height: 80px;
    --header-bg: rgba(255, 255, 255, 0.8);
    --header-border: rgba(0, 0, 0, 0.08);
    --header-shadow: 0 4px 20px rgba(0, 82, 212, 0.08);
    --text-dark: #212529;
    --text-muted: #6c757d;
    --primary-accent: #0052d4;
    --keya-adminbar: 0px;
    --secondary-accent: #65c7f7; /* fallback so gradient works on all pages */
}

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(--text-muted);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
    padding: 5px 0;
}

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

.site-navigation .menu a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-accent);
    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(--primary-accent), var(--secondary-accent));
    color: white;
    border: none;
}

.header-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 82, 212, 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;
}

/* 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));
}

.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    border-radius: 9999px;
    border: 1px solid #dfe7f3;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #0b2540;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    line-height: 1;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 12px rgba(0, 82, 212, 0.08);
    transition: all 0.2s ease;
}

.lang-toggle::before {
    content: "🌐";
    font-size: 1rem;
}

.lang-toggle:hover {
    background: linear-gradient(90deg, #0052d4, #65c7f7);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(0, 82, 212, 0.2);
}

.lang-toggle:focus-visible {
    outline: 2px solid #65c7f7;
    outline-offset: 3px;
}
