/* calculator-nav.css */
.calc-header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: auto;
}

.calc-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.home-link {
    text-decoration: none;
    color: inherit;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-img {
    height: 32px;
    width: auto;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color, #4CAF50);
}

.nav-right {
    display: flex;
    align-items: center;
}

.back-home {
    text-decoration: none;
    color: var(--primary-color, #4CAF50);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-color, #4CAF50);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.back-home:hover {
    background-color: var(--primary-color, #4CAF50);
    color: white;
}

/* Hamburger menu styles */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1010;
    position: relative;
}

.hamburger-bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    background-color: var(--primary-color, #4CAF50);
    transition: all 0.3s ease;
}

/* Navigation menu structure */
.nav-menu {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Base menu items styles - minimal to avoid conflicts */
.menu-items {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease-in-out;
}

/* Update your existing container class to account for the fixed header */
/* Override the main container to position it below our fixed header */
.container {
    margin-top: 80px !important; /* Add space below the fixed header */
    position: relative;
    z-index: 1;
}

/* Desktop styles */
@media (min-width: 769px) {
    /* Configure the header for desktop view */
    .calc-header {
        height: 60px;
        max-height: 60px;
        position: fixed;
        width: 100%;
        z-index: 1000;
    }
    
    /* Adjust container margin for desktop */
    .container {
        margin-top: 70px !important; /* Slightly reduced for desktop */
    }
    
    /* Remove the full-screen menu structure for desktop */
    .nav-menu {
        width: 100%;
        height: 60px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    /* Completely redesigned menu for desktop - no full screen overlay */
    .menu-items {
        position: static; /* Not fixed or relative */
        display: flex;
        flex-direction: row;
        width: auto; /* Don't force width to 100% */
        max-height: 60px; /* Constrain height to header */
        background: transparent;
        box-shadow: none;
        padding: 0;
        transform: none !important; /* Override any transforms */
    }
    
    /* Hide hamburger on desktop */
    .hamburger {
        display: none;
    }
    
    /* Logo and home link styling for desktop */
    .home-link {
        display: flex;
        align-items: center;
    }
    
    .logo {
        margin-right: 0;
    }
    
    /* Back to home link positioning */
    .nav-right {
        margin-left: auto; /* Push to right side */
    }

    /* Adjust logo size for better fit */
    .logo-img {
        height: 28px;
    }
    
    /* Navigation layout */
    .calc-nav {
        display: flex;
        align-items: center;
        width: 100%;
        height: 100%;
        padding: 0 2rem;
    }
}

/* Responsive styles for mobile */
@media (max-width: 768px) {
    .calc-nav {
        padding: 1rem;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    /* Show hamburger menu on mobile */
    .hamburger {
        display: block;
        position: absolute;
        right: 1rem;
        top: 1rem;
    }
    
    /* Mobile menu styling */
    .menu-items {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh; /* Set a specific height for mobile view */
        background: white;
        flex-direction: column;
        padding: 4rem 1.5rem 1.5rem;
        transform: translateY(-100%);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        z-index: 1005;
    }
    
    /* Animation for menu open state - MOBILE ONLY */
    .nav-menu.open .menu-items {
        transform: translateY(0);
        transition: transform 0.3s ease-in-out;
    }
    
    /* Animation for hamburger to X */
    .nav-menu.open .hamburger-bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }
    
    .nav-menu.open .hamburger-bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-menu.open .hamburger-bar:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }
    
    /* Style the logo and nav-right in mobile view */
    .logo {
        margin-bottom: 1rem;
    }
    
    .nav-right {
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .logo-img {
        height: 24px;
    }
    
    .back-home {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}