/* ========================================
   Enhanced Topbar Styles
   ======================================== */

/* Topbar Container */
.topbar {
    background: linear-gradient(to right, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.98));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.03);
}

.dark .topbar {
    background: linear-gradient(to right, rgba(30, 41, 55, 0.95), rgba(30, 41, 55, 0.98));
    border-bottom-color: rgba(55, 65, 81, 0.8);
}

.topbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    max-width: 100%;
}

@media (min-width: 1024px) {
    .topbar-container {
        padding: 0.875rem 1.5rem;
    }
}

/* Left Section */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.topbar-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    color: #64748b;
    background: #f1f5f9;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dark .topbar-hamburger {
    background: #374151;
    color: #9ca3af;
}

.topbar-hamburger:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.dark .topbar-hamburger:hover {
    background: #4b5563;
    color: #f1f5f9;
}

/* Page Info */
.topbar-page-info {
    display: flex;
    align-items: center;
}

.topbar-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.2;
}

.dark .topbar-title {
    color: #f1f5f9;
}

/* Center Section - Search */
.topbar-center {
    flex: 1;
    display: none;
    justify-content: center;
    max-width: 480px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .topbar-center {
        display: flex;
    }
}

.topbar-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.dark .topbar-search {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-color: #374151;
}

.topbar-search:focus-within {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
    background: white;
}

.dark .topbar-search:focus-within {
    background: #1e293b;
}

.topbar-search-icon {
    display: flex;
    align-items: center;
    color: #94a3b8;
    margin-right: 0.625rem;
    flex-shrink: 0;
}

.topbar-search:focus-within .topbar-search-icon {
    color: #0ea5e9;
}

.topbar-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.875rem;
    color: #1e293b;
    min-width: 0;
}

.dark .topbar-search-input {
    color: #f1f5f9;
}

.topbar-search-input::placeholder {
    color: #94a3b8;
}

.topbar-search-shortcut {
    display: none;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.75rem;
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .topbar-search-shortcut {
        display: flex;
    }
}

.topbar-search-shortcut kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.375rem;
    padding: 0 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    font-family: inherit;
    color: #64748b;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.dark .topbar-search-shortcut kbd {
    background: #374151;
    border-color: #4b5563;
    color: #9ca3af;
}

/* Right Section */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .topbar-right {
        gap: 0.75rem;
    }
}

/* Quick Action Button */
.topbar-quick-action {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

@media (min-width: 1024px) {
    .topbar-quick-action:not(.hidden) {
        display: flex;
    }
}

.topbar-quick-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.topbar-quick-action:active {
    transform: translateY(0);
}

/* Action Buttons */
.topbar-action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dark .topbar-action-btn {
    background: #374151;
    color: #9ca3af;
}

.topbar-action-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #e2e8f0;
}

.dark .topbar-action-btn:hover {
    background: #4b5563;
    color: #f1f5f9;
}

/* Notification Badge */
.topbar-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* User Profile Button */
.topbar-user-profile {
    position: relative;
    margin-left: 0.5rem;
}

.topbar-user-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem 0.75rem 0.375rem 0.375rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dark .topbar-user-btn {
    background: #374151;
    border-color: #4b5563;
}

.topbar-user-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.dark .topbar-user-btn:hover {
    background: #4b5563;
}

.topbar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8125rem;
    font-weight: 600;
}

.topbar-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.topbar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1e293b;
}

.dark .topbar-user-name {
    color: #f1f5f9;
}

.topbar-user-role {
    font-size: 0.6875rem;
    color: #64748b;
}

.topbar-user-chevron {
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.topbar-user-btn:hover .topbar-user-chevron {
    color: #64748b;
}

.topbar-user-btn[aria-expanded="true"] .topbar-user-chevron {
    transform: rotate(180deg);
}

/* Dropdowns */
.topbar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    z-index: 9999;
    animation: dropdown-enter 0.2s ease;
}

.topbar-dropdown.hidden {
    display: none !important;
}

.dark .topbar-dropdown {
    background: #1e293b;
    border-color: #374151;
}

@keyframes dropdown-enter {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.topbar-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
}

.dark .topbar-dropdown-header {
    background: linear-gradient(to right, #1e293b, #111827);
    border-color: #374151;
}

.topbar-dropdown-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.dark .topbar-dropdown-header h3 {
    color: #f1f5f9;
}

.topbar-dropdown-action {
    font-size: 0.75rem;
    font-weight: 500;
    color: #0ea5e9;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.topbar-dropdown-action:hover {
    color: #0284c7;
}

.topbar-dropdown-content {
    max-height: 320px;
    overflow-y: auto;
}

.topbar-dropdown-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    color: #94a3b8;
    text-align: center;
}

.topbar-dropdown-empty svg {
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.topbar-dropdown-empty p {
    font-size: 0.875rem;
    margin: 0;
}

/* User Dropdown */
.topbar-user-dropdown {
    min-width: 240px;
}

.topbar-dropdown-user-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    color: white;
}

.topbar-dropdown-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.topbar-dropdown-menu {
    padding: 0.5rem;
}

.topbar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #475569;
    text-decoration: none;
    border-radius: 0.625rem;
    transition: all 0.15s ease;
}

.dark .topbar-dropdown-item {
    color: #cbd5e1;
}

.topbar-dropdown-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.dark .topbar-dropdown-item:hover {
    background: #374151;
    color: #f1f5f9;
}

.topbar-dropdown-item svg {
    color: #94a3b8;
}

.topbar-dropdown-item:hover svg {
    color: #0ea5e9;
}

.topbar-dropdown-footer {
    padding: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

.dark .topbar-dropdown-footer {
    border-color: #374151;
}

.topbar-dropdown-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #ef4444;
    background: #fef2f2;
    border: none;
    border-radius: 0.625rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dark .topbar-dropdown-logout {
    background: rgba(239, 68, 68, 0.1);
}

.topbar-dropdown-logout:hover {
    background: #fee2e2;
}

.dark .topbar-dropdown-logout:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ========================================
   Mobile Responsive
   ======================================== */
@media (max-width: 639px) {
    .topbar-container {
        padding: 0.625rem 0.75rem;
    }
    
    .topbar-left {
        gap: 0.5rem;
    }
    
    .topbar-hamburger {
        width: 36px;
        height: 36px;
    }
    
    .topbar-action-btn {
        width: 36px;
        height: 36px;
    }
    
    .topbar-right {
        gap: 0.375rem;
    }
    
    .topbar-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        min-width: 100%;
        border-radius: 1.5rem 1.5rem 0 0;
        max-height: 70vh;
    }
    
    .topbar-dropdown-content {
        max-height: calc(70vh - 60px);
    }
}

@media (min-width: 640px) {
    .topbar-dropdown {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        bottom: auto;
        left: auto;
        min-width: 280px;
        border-radius: 1rem;
        max-height: none;
    }
    
    .topbar-user-dropdown {
        min-width: 240px;
    }
}

@media (max-width: 479px) {
    .topbar-notification-badge {
        min-width: 16px;
        height: 16px;
        font-size: 0.625rem;
        top: -2px;
        right: -2px;
    }
}

/* ========================================
   Notification Items
   ======================================== */
.notification-item {
    display: flex;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
    cursor: pointer;
}

.dark .notification-item {
    border-color: #374151;
}

.notification-item:hover {
    background: #f8fafc;
}

.dark .notification-item:hover {
    background: #374151;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background: #f0f9ff;
}

.dark .notification-item.unread {
    background: rgba(14, 165, 233, 0.1);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon.info {
    background: #dbeafe;
    color: #2563eb;
}

.notification-icon.success {
    background: #d1fae5;
    color: #059669;
}

.notification-icon.warning {
    background: #fef3c7;
    color: #d97706;
}

.notification-icon.error {
    background: #fee2e2;
    color: #dc2626;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
    margin: 0 0 0.25rem 0;
}

.dark .notification-title {
    color: #f1f5f9;
}

.notification-message {
    font-size: 0.8125rem;
    color: #64748b;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 0.6875rem;
    color: #94a3b8;
    margin-top: 0.375rem;
}
