body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f7f9fb;
    box-sizing: border-box;
}

nav {
    background: linear-gradient(90deg, #007bff 60%, #0056b3 100%);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1500;
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.13);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    height: 64px;
    border-radius: 0 0 18px 18px;
    overflow: visible;
    transition: background 0.2s, box-shadow 0.2s;
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 28px;
    box-sizing: border-box;
    position: relative;
    z-index: 99;
}

.logo {
    display: flex;
    align-items: center;
    height: 100%;
    min-width: 120px;
}
.logo h1 {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0;
    padding: 0 10px 0 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.search-bar-div {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 180px;
    max-width: 400px;
    margin: 0 18px;
}

.other-section {
    display: flex;
    align-items: center;
    gap: 18px;
    transition: none;
}

.ul-with-btn {
    display: flex;
    align-items: center;
    gap: 10px;
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
}
nav ul li a:hover,
nav ul li a.active {
    background: #fff;
    color: #007bff;
    transform: scale(1.07);
}

.Login-option {
    margin-left: 18px;
}
.Login-option a {
    background: #fff;
    color: #007bff;
    border: none;
    padding: 8px 20px;
    border-radius: 24px;
    font-weight: bold;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 4px rgba(0,123,255,0.07);
}
.Login-option a:hover {
    background: #0056b3;
    color: #fff;
}

.nav-search-form {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: 20px;
    padding: 2px 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    margin-left: 18px;
    transition: box-shadow 0.2s;
    width: 100%;
    max-width: 320px;
    box-sizing: border-box;
}
.nav-search-form input[type="search"] {
    border: none;
    outline: none;
    padding: 7px 10px;
    font-size: 1rem;
    background: transparent;
    width: 140px;
    transition: width 0.3s;
}
.nav-search-form button {
    background: none;
    border: none;
    color: #007bff;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 6px;
    transition: color 0.2s;
}
.nav-search-form button:hover {
    color: #0056b3;
}

.hamburger-menu {
    display: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    border-radius: 8px;
    padding: 4px 8px;
    transition: background 0.2s;
    position: absolute;
    right: 24px;
    top: 12px;
    z-index: 2100;
}
.hamburger-menu:hover {
    background: rgba(255,255,255,0.12);
}

@media (max-width: 1200px) {
    .nav-container {
        max-width: 1000px;
        padding: 0 12px;
    }
}
@media (max-width: 900px) {
    .nav-search-form input[type="search"] {
        width: 80px;
    }
    nav {
        height: 56px;
    }
    .logo h1 {
        font-size: 1.3rem;
    }
}

@media (max-width: 770px) {
    nav {
        height: 56px;
        border-radius: 0 0 12px 12px;
    }
    .nav-container {
        flex-direction: row;
        padding: 0 4px 0 3%;
    }
    .hamburger-menu {
        display: block;
        padding: 0;
    }
    .other-section {
        display: none;
        position: absolute;
        top: 64px;
        right: 0;
        background: linear-gradient(90deg, #007bff 60%, #0056b3 100%);
        flex-direction: column;
        width: 240px;
        min-height: 100vh;
        align-items: flex-start;
        padding: 18px 0 0 0;
        gap: 0;
        box-shadow: 0 2px 8px rgba(0, 123, 255, 0.09);
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(.77,0,.18,1);
        z-index: 2000;
        border-radius: 0 0 0 18px;
        overflow-y: auto;
    }
    .other-section.open {
        display: flex;
        transform: translateX(0);
        top:52px;
        z-index: -1;
    }
    .ul-with-btn {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    .ul-with-btn ul li{
        width: 100%;
        display: flex;
    }
    .ul-with-btn ul li a {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    nav ul {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    nav ul li a {
        width: 100%;
        border-radius: 0;
        padding: 14px 24px;
        justify-content: flex-start;
    }
    .Login-option {
        width: 100%;
        margin: 10px 0 0 0;
        padding: 10px 24px;
        text-align: center;
    }
    
    .nav-search-form {
        width: 50%;
        margin: 10px 0 0 0;
        max-width: 220px;
        justify-content: center;
    }

    .search-bar-div{
        padding-bottom: 2%;
        min-width: 63%;
        justify-content: space-between;
    }
}

@media (max-width: 600px) {
    .logo h1 {
        font-size: 1.1rem;
    }
    nav {
        height: 48px;
        border-radius: 0 0 8px 8px;
    }
    .nav-container {
        /* padding: 0 2px; */
    }
    .nav-search-btn{
        margin-right: 8%;
    }
    .nav-search-form{
        padding: 4px 30%;
    }
}

/* Prevent overflow and ensure navbar always stays within body */
html, body {
    width: 100%;
    overflow-x: hidden;
}
nav, .nav-container, .other-section, .ul-with-btn, nav ul, .Login-option, .nav-search-form {
    box-sizing: border-box;
}