/* Modern header layout for ENGINE DYNAMO
   - Left: logo
   - Center: centered nav with wider gaps
   - Right: search + social icons
*/

.site-header {
	background: rgba(255,255,255,0.15);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid rgba(255,255,255,0.1);
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	transition: all 0.3s ease;
}

.header-content {
	display: flex;
	align-items: center;
	gap: 20px;
	justify-content: space-between;
	padding: 0 15px;
}

.header-left {
	display: flex;
	align-items: center;
	gap: 12px;
}

.site-logo img {
	height: 44px;
	width: auto;
	display: block;
}

.logo-text { 
	display: inline-block; 
	margin-left: 10px; 
	color: #e6f0ff; 
	font-weight: 800; 
	letter-spacing: -0.01em;
	font-size: 0.95rem;
	line-height: 1;
}

/* Ensure both logo words are visually identical in size/weight and aligned */
.site-logo .logo-text .engine,
.site-logo .logo-text .dynamo {
	display: inline-block;
	font-size: 16px; /* matches global .logo-text .engine/.dynamo */
	font-weight: 800;
	color: #e6f0ff;
	line-height: 1;
	vertical-align: middle;
	margin: 0 2px;
}

.header-center { flex: 1; display: flex; justify-content: center; }

.centered-nav .nav-menu {
	display: flex;
	align-items: center;
	gap: 36px; /* wider gaps for premium feel */
	list-style: none;
	margin: 0;
	padding: 0;
}

.centered-nav .nav-menu li { margin: 0; }
.centered-nav .nav-menu li a {
	color: #cfe6ff;
	text-decoration: none;
	font-weight: 600;
	letter-spacing: 0.01em;
	padding: 10px 6px;
	transition: color 180ms ease, transform 180ms ease;
}
.centered-nav .nav-menu li a:hover {
	color: #ffffff;
	transform: translateY(-2px);
}

.header-right { 
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
    padding-right: 10px;
    flex-shrink: 0;
}

.search-container {
    /* Wider to show full search text and clear button */
    width: 160px;
    min-width: 160px;
    flex-shrink: 0;
    flex-basis: 160px;
}

.search-container {
    position: relative;
}

.search-container .search-form {
    position: relative;
    background: rgba(255,255,255,0.1);
    border-radius: 50px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    height: 40px;
    overflow: hidden;
}

.search-container .search-field {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    padding: 0 30px 0 15px; /* increased right padding for the clear button */
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
}

.search-container .search-field::-webkit-search-cancel-button {
    position: absolute;
    right: 10px;
    -webkit-appearance: none;
    height: 14px;
    width: 14px;
    color: white;
    cursor: pointer;
    content: 'x';
}

.search-container .search-submit {
    display: none;
}

.search-container .search-field::placeholder {
    color: rgba(255,255,255,0.8);
    opacity: 1;
}

.search-container .search-field:focus {
    outline: none;
}

.search-container .search-form:focus-within {
    background: rgba(255,255,255,0.2);
}

/* Search styling */

.header-social {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    min-width: max-content;
}

.header-social .social-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.header-social .social-icon:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.header-social .social-icon.facebook:hover { box-shadow: 0 5px 15px rgba(24,119,242,0.3); }
.header-social .social-icon.twitter:hover { box-shadow: 0 5px 15px rgba(29,161,242,0.3); }
.header-social .social-icon.instagram:hover { box-shadow: 0 5px 15px rgba(225,48,108,0.3); }
.header-social .social-icon.youtube:hover { box-shadow: 0 5px 15px rgba(255,0,0,0.3); }

/* Add padding to body to account for fixed header */
body {
    padding-top: 80px;
}

/* Responsive styles */
@media (max-width: 980px) {
    .header-right {
        grid-template-columns: 90px auto;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 10px 15px;
    }
    .centered-nav {
        display: none;
    }
    .header-right {
        grid-template-columns: 80px auto;
        gap: 12px;
    }

    /* Mobile menu: show as an overlay panel when active to avoid narrow centered column */
    .nav-menu {
        display: none; /* default hidden, toggled by JS via .active */
    }

    .nav-menu.active {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        position: fixed;
        top: 0;
        left: 0; /* anchor to left for a consistent slide-in panel */
        height: 100vh;
        width: 320px; /* slightly wider for readability */
        max-width: 92vw;
        padding: 90px 18px 24px 18px; /* account for fixed header */
        background: linear-gradient(180deg, rgba(8,12,24,0.99), rgba(6,8,16,0.98));
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        box-shadow: 8px 0 30px rgba(2,6,23,0.7);
        z-index: 1200;
        overflow-y: auto;
        gap: 6px;
        margin: 0 !important; /* prevent centering inside customizer */
    }

    /* Ensure nav links fill container and are readable */
    .nav-menu.active > li {
        width: 100%;
    }

    .nav-menu.active a {
        display: block;
        width: 100%;
        padding: 14px 16px;
        color: #eef6ff;
        font-size: 1.06rem;
        text-align: left;
        border-radius: 6px;
        transition: background 160ms ease, transform 120ms ease;
    }

    .nav-menu.active a:hover { background: rgba(255,255,255,0.03); transform: translateX(4px); }

    /* Add subtle separators between top-level items for clarity */
    .nav-menu.active > li + li { border-top: 1px solid rgba(255,255,255,0.03); }

    /* Mobile dropdowns: make them expand inline rather than absolute-positioned */
    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 180px;
        background: rgba(10,15,28,0.98);
        border-radius: 6px;
        padding: 0.5rem 0;
        box-shadow: 0 8px 24px rgba(2,6,23,0.6);
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
        transition: opacity 260ms cubic-bezier(0.22,1,0.36,1), transform 260ms cubic-bezier(0.22,1,0.36,1);
        pointer-events: none;
        z-index: 1050;
    }

    /* Override dropdown styles for mobile when nav is active: make them static and full-width */
    .nav-menu.active .dropdown-menu {
        position: static;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto;
        box-shadow: none;
        background: transparent;
        padding: 6px 0 6px 0;
        margin: 6px 0 0 0;
        width: 100%;
    }

    .nav-menu.active .dropdown-menu a {
        display: block;
        padding: 10px 16px 10px 32px; /* indent dropdown items */
        color: rgba(255,255,255,0.92);
        font-size: 0.98rem;
        border-radius: 4px;
    }

    .nav-menu.active .dropdown-menu a:hover { background: rgba(255,255,255,0.02); transform: translateX(3px); }

    /* Make nested dropdown sections slightly muted to improve hierarchy */
    .nav-menu.active .dropdown-menu li { opacity: 0.95; }

    /* Improve scrollbar visibility inside the nav panel */
    .nav-menu.active::-webkit-scrollbar { width: 9px; }
    .nav-menu.active::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 8px; }
}

@media (max-width: 480px) {
    .header-content {
        position: relative;
    }
    .search-container {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.15);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 10px;
        display: none;
        z-index: 1000;
    }
    .search-container.active {
        display: block;
    }
    .search-container .search-form {
        width: 100%;
        min-width: 0;
    }
    .header-social .social-icon {
        width: 30px;
        height: 30px;
    }
}
