.app-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: var(--primary-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.app-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-bar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.app-bar-brand i {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.app-bar-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: 32px;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-item:hover {
    color: var(--primary-color);
    background-color: var(--hover-bg);
}

.nav-item.active {
    color: var(--primary-color);
    background-color: var(--active-bg);
}

.app-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mobile Menu Button */
.menu-button {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-primary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.menu-button:hover {
    background-color: var(--hover-bg);
}

/* Mobile Drawer */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background-color: var(--primary-bg);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.mobile-drawer.open {
    left: 0;
}

.drawer-header {
    height: 64px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.drawer-close {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-primary);
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-close:hover {
    background-color: var(--hover-bg);
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-nav .nav-item {
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.drawer-nav .nav-item i {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.drawer-profile {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
}

.user-info {
    flex: 1;
}

.user-info .user-email {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.drawer-profile-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background-color: var(--primary-bg);
    border-top: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.drawer-profile-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.drawer-profile-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.drawer-profile-menu .menu-item:hover {
    background-color: var(--hover-bg);
}

.drawer-profile-menu .menu-item i {
    font-size: 1.1rem;
    color: var(--text-secondary);
    width: 20px;
    text-align: center;
}

.drawer-profile-menu .menu-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 4px 0;
}

.drawer-profile .toggle-icon {
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.drawer-profile.open .toggle-icon {
    transform: rotate(180deg);
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* User Profile Dropdown */
.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    height: 40px;
    border-radius: 20px;
    background-color: var(--hover-bg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-profile:hover {
    background-color: var(--active-bg);
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.user-name {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
    padding-right: 4px;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: var(--primary-bg);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    z-index: 1001;
}

.user-profile:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 12px 12px;
}

.dropdown-item i {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.dropdown-item:hover {
    background-color: var(--hover-bg);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 4px 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .app-bar {
        padding: 0 16px;
    }

    .menu-button {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .app-bar-nav {
        display: none;
    }

    .user-name {
        display: none;
    }

    .user-profile {
        display: none;
    }
}

/* Theme-specific styles */
[data-theme="dark"] .app-bar {
    background-color: var(--primary-bg);
    border-bottom-color: var(--border-color);
}

/* Animation for nav items */
.nav-item {
    position: relative;
    overflow: hidden;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 100%;
}
