/* Modern Navbar - Bootstrap Compatible */
.navbar {
    background-color: rgba(245, 245, 247, 0.7);
    padding: 0.8rem 1rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 70px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin: 10px 200px;
    position: sticky;
    top: 15px;
    z-index: 1000;
    transition: all 0.3s ease-in-out;
}

body.dark-mode .navbar {
    background-color: rgba(29, 29, 31, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 1rem;
}

.navbar-brand .logo-container {
    display: flex;
    align-items: center;
}

.navbar-brand img {
    width: auto;
    height: 70px;
    transition: transform 0.3s ease;
}

.navbar-brand:hover img {
    transform: scale(1.25);
}

.lab-name {
    font-size: 1.6rem;
    font-weight: 600;
    color: #1d1d1f;
    text-align: center;
    flex-grow: 1;
    white-space: nowrap;
    margin: 0 1rem;
}

body.dark-mode .lab-name {
    color: #e8e8ed;
}

.navbar-nav .nav-link {
    color: #1d1d1f !important;
    font-size: 1rem;
    font-weight: 400;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    margin: 0 0.25rem;
}

body.dark-mode .navbar-nav .nav-link {
    color: #e8e8ed !important;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #0071e3 !important;
}

body.dark-mode .navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #2997FF !important;
}

.navbar-nav .nav-link.active {
    background-color: rgba(0, 0, 0, 0.08);
}

body.dark-mode .navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
}

.navbar-toggler {
    border: none;
}

.navbar-toggler:focus,
.navbar-toggler:active {
    outline: 0;
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

body.dark-mode .navbar-toggler {
    border: none;
}

body.dark-mode .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.dark-mode-switch {
    margin-left: 1rem;
}

@media (max-width: 991.98px) {
    .navbar {
        padding: 0.8rem 1rem;
        margin: 10px 15px;
    }
    .navbar-brand img {
        height: 50px;
    }
    .lab-name {
        font-size: 1rem;
        white-space: normal;
        flex-shrink: 1;
    }
    .navbar-nav .nav-link {
        font-size: 1rem;
    }
    .navbar-nav {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    .nav-item {
        width: 100%;
    }
}

@media (max-width: 404px) {
    .navbar {
        padding: 0.5rem 0.7rem;
        margin: 10px 5px;
        border-radius: 20px;
        flex-wrap: wrap; /* Allow items to wrap */
        justify-content: space-between; /* Space out brand and toggler */
    }

    .navbar-brand {
        margin-right: 0.5rem;
    }

    .navbar-brand img {
        height: 40px; /* Further reduce logo size */
    }

    .lab-name {
        font-size: 0.9rem; /* Smaller font size for lab name */
        white-space: normal; /* Allow text to wrap */
        flex-grow: 0; /* Don't let it take up too much space */
        margin: 0 0.5rem;
    }

    .navbar-toggler {
        padding: 0.25rem 0.5rem; /* Adjust toggler padding */
    }

    .navbar-toggler-icon {
        width: 1.2em;
        height: 1.2em;
    }

    .dark-mode-switch {
        margin-left: 0; /* Remove left margin for better fit */
        margin-top: 10px; /* Add some top margin if it wraps */
        width: 50px !important; /* Adjust switch size */
        height: 25px !important;
    }

    .dark-mode-switch .slider {
        border-radius: 25px;
    }

    .dark-mode-switch .ball {
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
    }

    input:checked + .slider .ball {
        -webkit-transform: translateX(25px);
        -ms-transform: translateX(25px);
        transform: translateX(25px);
    }
}