/* --- CSS Reset for Full Width --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* --- Component Variables --- */
:root {
    --header-bg-color: #4a0202; /* Deep Maroon matching the image */
    --header-text-color: #ffffff;
    --header-accent-color: #c49a18; /* Gold/Mustard for button & logo accents */
    --header-font-stack: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --header-height: 80px;
}

/* --- Main Header Container --- */
.slecic-header {
    /* Start with a dark transparent gradient over the hero section */
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.75) 10%,
        rgba(0, 0, 0, 0.45) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    color: #ffffff;
    font-family: var(--header-font-stack);
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px; /* Adjust side spacing as needed */
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0;
    position: fixed; /* Keep header on top while scrolling */
    top: 0;
    left: 0;
    z-index: 1000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Background + subtle shadow after scrolling */
.slecic-header.scrolled {
    background: var(--primary-color) !important;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    /* Remove any gradient, just solid white */
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); */
}

.slecic-header.scrolled .header-nav .nav-link {
    color: var(--header-text-color) !important;
}

.slecic-header.scrolled .header-nav .nav-link:hover {
    color: var(--secondary-color) !important;
}

.slecic-header.scrolled .header-nav .nav-link.current {
    color: var(--secondary-color) !important;
}

/* --- Logo Section --- */
.header-branding .brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    gap: 12px;
}

.header-branding .brand-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

/* --- Navigation Menu --- */
.header-nav .nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 25px; /* Spacing between links */
}

.header-nav .nav-link {
    text-decoration: none;
    color: #ffffff; /* Black when header is transparent */
    font-size: 14px;
    font-weight: 500;
    padding-bottom: 4px;
    transition: color 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-nav .nav-link i {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.header-nav .nav-link:hover {
    color: #dda919;
}

/* --- Dropdown Menu --- */
.nav-item-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--header-bg-color);
    list-style: none;
    margin: 0;
    padding: 10px 0;
    min-width: 220px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 1001;
    margin-top: 8px;
}

/* Desktop: Show dropdown on hover - works when hovering over parent */
.nav-item-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-item-dropdown:hover .nav-link i {
    transform: rotate(180deg);
}

/* Ensure dropdown stays visible when moving mouse from trigger to menu */
@media (min-width: 769px) {
    .nav-item-dropdown:hover .dropdown-menu {
        pointer-events: all;
    }
    
    /* Small gap fix - ensure smooth hover transition */
    .dropdown-menu::before {
        content: '';
        position: absolute;
        top: -8px;
        left: 0;
        right: 0;
        height: 8px;
    }
}

.dropdown-menu li {
    margin: 0;
    padding: 0;
}

.dropdown-link {
    display: block;
    padding: 10px 20px;
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
    border-left: 3px solid transparent;
}

.dropdown-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--header-accent-color);
    padding-left: 25px;
    border-left-color: var(--header-accent-color);
}

/* Active State (Home) styling */
.header-nav .nav-link.current {
    color: #caa21d;
}

.header-nav .nav-link.current::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 25px; /* Width of the underline */
    height: 2px;
    background-color: #caa21d;
}

/* When header has background, switch text & links to white for contrast */
.slecic-header.scrolled,
.slecic-header.scrolled .header-nav .nav-link,
.slecic-header.scrolled .header-nav .nav-link.current {
    color: #caa21d;
}

.slecic-header.scrolled .header-nav .nav-link:hover {
    color: #ffffff;
}

/* Ensure dropdown menu background matches scrolled header */
.slecic-header.scrolled .dropdown-menu {
    background-color: var(--header-bg-color);
}

/* --- CTA Button (Client Area) --- */
.btn-client-area {
    background-color: var(--header-accent-color);
    color: #ffffff;
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 25px; /* Pill shape */
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.btn-client-area:hover {
    background-color: #d4a81e; /* Slightly lighter gold on hover */
}

.btn-client-area:active {
    transform: scale(0.98);
}

/* --- Mobile Menu Toggle Button (Hamburger) --- */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
    position: relative;
    transition: transform 0.3s ease;
}

.mobile-menu-toggle:focus {
    outline: 2px solid var(--header-accent-color);
    outline-offset: 2px;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: #ffffff;
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Hamburger animation when menu is open */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* --- Mobile Menu Overlay --- */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: all;
}

/* --- Tablet Responsive Styles --- */
@media (max-width: 1024px) {
    .slecic-header {
        padding: 0 20px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .header-actions {
        margin-right: 15px;
    }
    
    .btn-client-area {
        padding: 8px 18px;
        font-size: 12px;
    }
    
    /* Desktop/Tablet: Keep horizontal nav visible */
    .header-nav {
        display: block;
    }
    
    .nav-list {
        gap: 20px;
    }
    
    .header-nav .nav-link {
        font-size: 13px;
    }
    
    /* Ensure desktop hover still works on tablets */
    .nav-item-dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .nav-item-dropdown:hover .nav-link i {
        transform: rotate(180deg);
    }
}

@media (max-width: 768px) {
    .slecic-header {
        padding: 0 15px;
        height: 70px;
        /* Static background color on mobile - no transparent gradient */
        background: var(--header-bg-color) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    }
    
    /* Remove scroll effect on mobile - always show solid background */
    .slecic-header.scrolled {
        background: var(--header-bg-color) !important;
    }
    
    .header-branding .brand-logo {
        height: 45px;
    }
    
    .header-actions {
        display: none; /* Hide client area button on mobile, can be shown in menu if needed */
    }
    
    /* Mobile Menu Styles */
    .header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 350px;
        height: 100vh;
        background-color: var(--header-bg-color);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
        transition: right 0.3s ease;
        z-index: 1001;
        overflow-y: auto;
        padding: 80px 0 30px 0;
    }
    
    .header-nav.active {
        right: 0;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 0;
        padding: 0;
        width: 100%;
    }
    
    .nav-list > li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .header-nav .nav-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        font-size: 15px;
        width: 100%;
        color: #ffffff;
    }
    
    .header-nav .nav-link i {
        font-size: 12px;
        transition: transform 0.3s ease;
    }
    
    /* Mobile Dropdown Styles */
    .nav-item-dropdown {
        position: static;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background-color: rgba(0, 0, 0, 0.3);
        box-shadow: none;
        border-radius: 0;
        margin: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        min-width: auto;
        width: 100%;
    }
    
    .nav-item-dropdown.active .dropdown-menu {
        max-height: 500px;
        padding: 10px 0;
    }
    
    .nav-item-dropdown.active .nav-link i {
        transform: rotate(180deg);
    }
    
    .dropdown-link {
        padding: 12px 20px 12px 40px;
        font-size: 14px;
        border-left: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .dropdown-link:hover {
        padding-left: 45px;
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    /* Remove hover effects on mobile, use active states */
    .header-nav .nav-link:hover {
        color: #ffffff;
    }
    
    .header-nav .nav-link.current {
        background-color: rgba(196, 154, 24, 0.2);
        color: var(--header-accent-color);
    }
    
    .header-nav .nav-link.current::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .slecic-header {
        padding: 0 10px;
        height: 65px;
    }
    
    .header-branding .brand-logo {
        height: 40px;
    }
    
    .header-nav {
        width: 90%;
        max-width: 300px;
    }
    
    .header-nav .nav-link {
        padding: 14px 15px;
        font-size: 14px;
    }
    
    .dropdown-link {
        padding: 11px 15px 11px 35px;
        font-size: 13px;
    }
}
