header {
  background: var(--background-color);
  width: 100%;
  padding: 0.0rem 0; /* Vertical padding only */
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0; /* Verhindert, dass der Header schrumpft */
}

/* NEW: This wrapper will align the header content with the main content */
.header-content-wrapper {
    width: 80%;
    max-width: 1100px;
    background: var(--background-color);
    padding: 0rem;
    margin: 0 auto; /* This centers the container */
    display: flex;
    justify-content: space-between; /* Pushes title left and nav right */
    align-items: center;
}


.header-title-container {
    text-align: left;
    display: flex;
    align-items: center;
}

/* Remove the generic .app-logo rule and replace with specific ones */
.app-logo-desktop {
    display: block; /* Visible by default */
    height: 25px;
    width: auto;
    margin: 0.4rem 5px 0.8rem 5px;
    filter: brightness(0) saturate(100%); /* Make logo black by default */
    transition: filter 0.3s ease-in-out;
}

.app-logo-mobile {
    display: none; /* Hidden by default */
    height: 35px;
    width: auto;
    margin: 5px;
    filter: brightness(0) saturate(100%); /* Make logo black by default */
    transition: filter 0.3s ease-in-out;
}

/* Invert logo color for dark mode */
.header-dark-mode .app-logo-desktop,
.header-dark-mode .app-logo-mobile {
    filter: brightness(0) saturate(100%) invert(1);
}

header h1 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.5px;
  color: var(--text-color); /* Using your existing dark text color for a modern, strong contrast */
  font-family: 'Poppins', sans-serif; /* New modern font */
  font-weight: 600; /* Poppins looks clean and modern at 600 (Semi-Bold) or 700 (Bold) */
}
header p.subtitle {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-top: 0.1rem;
    margin-bottom: 0;
}

#userInfoDropdown {
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--primary-color);
    border-bottom: 1px solid var(--card-secondary-bg);
}

/* ADD these new styles for the horizontal navigation */
.header-nav {
    display: flex;
    align-items: right;
    gap: 1rem;

}

.header-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 10px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.header-nav a.active {
    color: var(--primary-color);
    font-weight: 700; /* Make it bolder */
}

.header-nav a:hover {
    background-color: var(--card-secondary-bg);
    color: var(--primary-color);
}

/* Style for the special button-like link */
.header-nav a.nav-button {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(80, 101, 229, 0.2);
}

.header-nav a.nav-button:hover {
    background-color: #3F51E0; /* Darker shade of primary */
    color: #fff;
    transform: translateY(-2px);
}

/* NEW: Style for the active button-like link */
.header-nav a.nav-button.active-button {
    background-color: #3F51E0; /* Darker shade to indicate active */
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2); /* Inset shadow for a "pressed" look */
    transform: translateY(0); /* Prevent hover effect from lifting the active button */
}




/* === NEW: Mobile Navigation Toggle (Hamburger) === */
.mobile-nav-toggle {
    display: none; /* Hidden on desktop */
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 768px) {

    header {
        display:none;
        padding: 0.0rem 0rem;
        flex-direction: column;
        align-items: center;
    }
    .header-content-wrapper {
        display:none;
        width: 100%;
        flex-direction: row; /* Changed from column to row */
        justify-content: space-between; /* This will put logo left, hamburger right */
        align-items: center;
        padding: 0.5rem 1rem; /* Add some padding */
        gap: 1rem;
    }    

    .header-title-container {
        text-align: center;
        margin-bottom: 0.0rem;
        justify-content: center;
    }

    /* Hide desktop logo and show mobile logo */
    .app-logo-desktop {
        display: none;
    }
    .app-logo-mobile {
        display: none;
    }
    
    /* Remove the old .app-logo rule from here */
    
    /* Reduce header title font size */
    header h1 {
        font-size: 1.3rem; /* Reduced from 1.8rem */
        margin: 0;
    }
    
    /* Reduce subtitle font size if you decide to use it */
    header p.subtitle {
        font-size: 0.9rem; /* Reduced from 1.1rem */
        margin-top: 0;
        margin-bottom: 0;
    }
    
 
   .header-nav {
        display: none;
        position: fixed;
        z-index: 1000;
        inset: 0 0 0 30%; /* top, right, bottom, left */
        flex-direction: column;
        padding: min(20vh,10rem) 2rem;
        gap: 2rem;
        background: hsl(0 0% 100% / 0.1);
        backdrop-filter: blur(1rem);
        transform: translateX(100%);
        transition: transform 350ms ease-out;
    }

    .header-nav a {
        padding: 0.2rem 0.2rem;
        font-size: 0.9rem;
    }    

    .header-nav[data-visible="true"] {
        transform: translateX(0%);
    }

    /* Style for the special button-like link */
    .header-nav a.nav-button {
        background-color: transparent;
        color: var(--text-color);
        box-shadow: 0 0px 0px rgba(80, 101, 229, 0.2);
    }

    .mobile-nav-toggle {
        display: none;
        position: absolute;
        z-index: 2000;
        right: 1rem;
        top: 1rem;
        background: transparent;
        border: 0;
        width: 2rem;
        aspect-ratio: 1;
        background-image: url("data:image/svg+xml,%3csvg stroke='%23333' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3e%3cline x1='3' y1='12' x2='21' y2='12'%3e%3c/line%3e%3cline x1='3' y1='6' x2='21' y2='6'%3e%3c/line%3e%3cline x1='3' y1='18' x2='21' y2='18'%3e%3c/line%3e%3c/svg%3e");
        background-repeat: no-repeat;
    }

    .mobile-nav-toggle[aria-expanded="true"] {
        background-image: url("data:image/svg+xml,%3csvg stroke='%23333' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3e%3cline x1='18' y1='6' x2='6' y2='18'%3e%3c/line%3e%3cline x1='6' y1='6' x2='18' y2='18'%3e%3c/line%3e%3c/svg%3e");
    }
}