.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--topbar-height);
    padding: 0 1.5rem;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1030;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, box-shadow 0.3s ease;
}

body.light-theme .top-bar {
    background: rgba(255, 255, 255, 0.85);
}

body.details-view-active .top-bar {
    transform: translateY(-110%);
}

.top-bar-left, .top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.top-bar-center {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: var(--transition);
    cursor: pointer;
    padding: 0.5rem 0;
}

.logo:hover {
    transform: scale(1.03);
    filter: brightness(1.1);
}

.search-bar {
    position: relative;
    width: 100%;
    max-width: 450px;
}

.search-input {
    width: 100%;
    padding: 0.6rem 1.2rem 0.6rem 2.6rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    transition: var(--transition);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 224, 255, 0.2);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    transition: var(--transition);
    font-size: 0.9rem;
}

.search-input:focus+.search-icon {
    color: var(--accent);
}

.sidebar-nav {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--topbar-height));
    background: var(--secondary);
    z-index: 1020;
    border-right: 1px solid var(--glass-border);
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1.5rem 0;
}

body.light-theme .sidebar-nav {
    background: #eef2f7;
}

.sidebar-nav.open {
    transform: translateX(0);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu .nav-link {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.9rem 1.8rem;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.sidebar-menu .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-menu .nav-link:hover {
    color: var(--text-primary);
    background-color: var(--glass);
}

.sidebar-menu .nav-link.active {
    color: var(--accent);
    font-weight: 600;
    background: var(--glass);
    border-left-color: var(--accent);
}

@media (min-width: 992px) {
    /* #sidebar-toggle {
        display: none;
    } */
    .sidebar-nav {
        transform: translateX(0);
    }
    #main-container {
        padding-left: var(--sidebar-width);
    }
}

@media (max-width: 991px) {
    #sidebar-toggle {
        display: inline-flex;
    }
}

@media (max-width: 768px) {
    .top-bar-center {
        display: none;
    }
    .top-bar {
        justify-content: space-between;
    }
    .logo {
        margin-left: 0.5rem;
    }
    .search-bar {
        margin: 1rem;
        position: absolute;
        top: var(--topbar-height);
        left: 0;
        right: 0;
        width: auto;
        z-index: 1025;
        padding: 0 1rem;
        display: block;
        max-width: none;
    }
    #main-view {
        padding-top: var(--topbar-height);
    }
}

@media (max-width: 576px) {
    .top-bar {
        padding: 0 0.8rem;
    }
    .logo {
        font-size: 1.5rem;
    }
    .sidebar-nav {
        width: 100%;
        transform: translateX(-105%);
    }
    .btn-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
}

body.sidebar-open .sidebar-nav {
    transform: translateX(0);
}

body.sidebar-collapsed .sidebar-nav {
    transform: translateX(-100%);
}

body.sidebar-collapsed #main-container {
    padding-left: 0;
}
