/* header.css - Revised and improved layout */

/* Base header styling */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
    padding: 2.5rem 0;
}

/* Header container structure */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo styling */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 60px;
    transition: height 0.3s ease;
}

/* Navigation menu */
.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin-left: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
    position: relative;
    display: inline-block;
}

.nav-link:hover {
    color: var(--livro-yellow);
}

.nav-link.active {
    color: var(--livro-yellow);
    font-weight: 700;
}

.nav-link.active::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--livro-yellow);
    position: absolute;
    bottom: -5px;
    left: 0;
}

.nav-cta {
    background-color: var(--livro-yellow);
    color: var(--livro-dark);
    padding: 0.5rem 1.2rem;
    border-radius: 4px;
    font-weight: 700;
}

.nav-cta:hover {
    background-color: #fff;
    color: var(--livro-red);
}

/* Mobile Icons Container */
.mobile-icons {
    display: none; /* Hidden by default, shown on mobile */
    align-items: center;
}

/* Mobile login icon */
.mobile-login-icon {
    color: white;
    text-decoration: none;
    margin-right: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-login-icon .material-symbols-rounded {
    font-size: 28px;
}

/* Mobile login button in the menu */
.mobile-quick-login {
    display: flex;
    align-items: center;
    background-color: var(--livro-yellow);
    color: var(--livro-dark) !important;
    padding: 1rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
}

.mobile-quick-login .material-symbols-rounded {
    margin-right: 0.5rem;
}

/* Mobile menu hamburger */
.hamburger {
    display: flex;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
    align-items: center;
    justify-content: center;
}

.hamburger-icon {
    display: block;
    position: relative;
    width: 30px;
    height: 24px;
}

.hamburger-icon span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

.hamburger-icon span:nth-child(1) {
    top: 0;
}

.hamburger-icon span:nth-child(2),
.hamburger-icon span:nth-child(3) {
    top: 10px;
}

.hamburger-icon span:nth-child(4) {
    top: 20px;
}

.hamburger.active .hamburger-icon span:nth-child(1),
.hamburger.active .hamburger-icon span:nth-child(4) {
    opacity: 0;
}

.hamburger.active .hamburger-icon span:nth-child(2) {
    transform: rotate(45deg);
}

.hamburger.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg);
}

/* Mobile Navigation */
.mobile-nav {
    display: block;
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100%;
    background-color: var(--livro-cerulean);
    padding: 6rem 2rem 2rem;
    z-index: 9999; /* Using a very high z-index to override any other elements */
    overflow-y: auto;
    transition: right 0.4s ease-in-out;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.15);
}

.mobile-nav.active {
    right: 0;
}

/* Close button for mobile menu */
.mobile-nav-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1002;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.mobile-nav-close:hover {
    transform: rotate(90deg);
}

.mobile-nav-close .material-symbols-rounded {
    font-size: 32px;
}

/* Mobile menu items */
.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-item {
    margin: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-link {
    color: white !important;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    display: block;
    padding: 0.8rem 0;
    transition: color 0.3s ease, transform 0.3s ease;
}

.mobile-nav-link:hover {
    color: var(--livro-yellow) !important;
    transform: translateX(5px);
}

.mobile-nav-link.active {
    color: var(--livro-yellow) !important;
    font-weight: 700;
}

.mobile-nav-cta {
    background-color: var(--livro-yellow);
    color: var(--livro-dark) !important;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    margin-top: 1.5rem;
    display: inline-block;
    text-align: center;
}

.mobile-nav-cta:hover {
    background-color: white;
    color: var(--livro-red) !important;
    transform: none;
}

/* Remove bottom border from the last mobile menu item */
.mobile-nav-item:last-child {
    border-bottom: none;
}

/* Z-index handling */
header, 
.static-header,
header.scrolled {
    z-index: 9998; /* High but lower than mobile nav */
}

/* Page-specific header colors */
.static-header {
    background-color: var(--livro-cerulean);
}

.static-header.red-bg {
    background-color: var(--livro-red);
}

.static-header.cyan-bg {
    background-color: var(--livro-cyan);
}

.static-header.yellow-bg {
    background-color: var(--livro-yellow);
}

.static-header.yellow-bg .nav-link {
    color: var(--livro-dark);
}

/* Home page specific header */
body.home-page header {
    background-color: transparent;
}

/* Scrolled state */
header.scrolled {
    background-color: var(--livro-red);
    padding: 1rem 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

body.home-page header.scrolled {
    background-color: var(--livro-red);
}

header.scrolled .logo img {
    height: 40px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .nav-menu {
        display: none; /* Hide desktop nav menu */
    }
    
    .mobile-icons {
        display: flex; /* Show mobile icons container */
    }
    
    .header-container {
        padding: 0 1rem; /* Add some padding on mobile */
    }
    
    header, 
    .static-header {
        padding: 1.5rem 0; /* Reduced padding on mobile */
    }
    
    .logo img {
        height: 50px; /* Slightly smaller logo on mobile */
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    header, 
    .static-header {
        padding: 1rem 0; /* Even less padding on small devices */
    }
    
    .logo img {
        height: 40px; /* Smaller logo on very small screens */
    }
    
    .mobile-login-icon .material-symbols-rounded {
        font-size: 24px; /* Smaller icon on very small screens */
    }
}