/* header.css */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    padding-top: 60px; /* Prevents content from hiding behind the fixed header */
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: #2c3e50;
    padding: 10px 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-container {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap; /* Allows elements to wrap naturally */
}

.logo h1 {
    margin: 0;
    font-size: 24px;
    flex-shrink: 0; /* Prevents logo from shrinking */
}

.logo a {
    color: #e74c3c;
    text-decoration: none;
}

.search-bar {
    flex: 1; /* Takes remaining space */
    min-width: 150px; /* Prevents search bar from becoming too small */
    max-width: 600px;
}

.search-bar form {
    display: flex;
}

.search-bar input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.search-bar button {
    padding: 8px 16px;
    background-color: #e74c3c;
    border: none;
    color: white;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* Improved Main Navigation (Flexible & Wrapping) */
.main-nav ul {
    display: flex;
    flex-wrap: wrap; /* Allows nav items to wrap */
    gap: 10px 15px; /* Horizontal & vertical gap */
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: flex-end; /* Aligns items to the right */
}

.main-nav a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap; /* Prevents text from breaking into multiple lines */
    padding: 5px 0; /* Adds slight padding for better touch targets */
}

.main-nav a:hover {
    color: #e74c3c;
}

/* Mobile Menu (Hidden by Default) */
.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger div {
    width: 25px;
    height: 3px;
    background-color: #ecf0f1;
    margin: 4px 0;
}

.mobile-nav {
    display: none;
    background-color: #34495e;
    padding: 10px;
    width: 100%;
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav li {
    padding: 8px 0;
}

.mobile-nav a {
    color: #ecf0f1;
    text-decoration: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .main-nav {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .search-bar {
        order: 3;
        width: 100%;
        max-width: unset;
        margin-top: 10px;
    }

    .mobile-nav.active {
        display: block;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    /* Adjustments for medium screens */
    .main-nav ul {
        gap: 8px 12px; /* Slightly smaller gap */
    }

    .main-nav a {
        font-size: 13px; /* Slightly smaller font */
    }
}