/*
 * Modern Top Navigation Styles
 * A contemporary, sleek navigation bar for the main application
 */

:root {
    --nav-height: 70px;
    --nav-bg: #ffffff;
    --nav-bg-dark: #1e293b;
    --nav-border: #e2e8f0;
    --nav-border-dark: #334155;
    --nav-text: #334155;
    --nav-text-dark: #f1f5f9;
    --nav-text-muted: #64748b;
    --nav-text-muted-dark: #94a3b8;
    --nav-hover-bg: #f8fafc;
    --nav-hover-bg-dark: #334155;
    --nav-active-bg: #3b82f6;
    --nav-active-text: #ffffff;
    --nav-accent: #3b82f6;
    --nav-accent-hover: #2563eb;
    --nav-success: #10b981;
    --nav-warning: #f59e0b;
    --nav-danger: #ef4444;
    --nav-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --nav-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --nav-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark theme variables */
[data-bs-theme="dark"] {
    --nav-bg: var(--nav-bg-dark);
    --nav-border: var(--nav-border-dark);
    --nav-text: var(--nav-text-dark);
    --nav-text-muted: var(--nav-text-muted-dark);
    --nav-hover-bg: var(--nav-hover-bg-dark);
}

/* Modern Top Navbar */
.modern-top-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--nav-height);
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: var(--nav-shadow);
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 24px;
    max-width: 100%;
}

/* Left Section */
.navbar-left {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.page-title-section {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--nav-text);
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breadcrumb-nav {
    margin-top: 2px;
}

.breadcrumb {
    margin: 0;
    padding: 0;
    background: none;
    font-size: 12px;
    color: var(--nav-text-muted);
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '/';
    margin: 0 8px;
    color: var(--nav-text-muted);
}

.breadcrumb-item a {
    color: var(--nav-text-muted);
    text-decoration: none;
    transition: var(--nav-transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--nav-accent);
}

.breadcrumb-item.active {
    color: var(--nav-text);
    font-weight: 500;
}

/* Right Section */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-item {
    position: relative;
}

/* Modern Navigation Buttons */
.modern-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: none;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--nav-text);
    text-decoration: none;
    cursor: pointer;
    transition: var(--nav-transition);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.modern-nav-btn:hover {
    background: var(--nav-hover-bg);
    color: var(--nav-text);
    transform: translateY(-1px);
    box-shadow: var(--nav-shadow);
}

.modern-nav-btn:focus {
    outline: 2px solid var(--nav-accent);
    outline-offset: 2px;
}

.modern-nav-btn.active {
    background: var(--nav-active-bg);
    color: var(--nav-active-text);
    border-color: var(--nav-accent);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-text {
    font-weight: 500;
}

/* Search Button */
.search-btn {
    position: relative;
}

.search-shortcut {
    font-size: 11px;
    color: var(--nav-text-muted);
    background: var(--nav-hover-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* Notifications Button */
.notifications-btn {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--nav-danger);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
    animation: pulse 2s infinite;
}

/* Rate limited indicator */
.modern-nav-btn.rate-limited {
    opacity: 0.6;
    position: relative;
}

.modern-nav-btn.rate-limited::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: var(--nav-warning, #fbbf24);
    border-radius: 50%;
    border: 2px solid var(--nav-bg);
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.3; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* User Profile Button */
.user-profile-btn {
    padding: 6px 12px 6px 6px;
    gap: 12px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--nav-border);
    transition: var(--nav-transition);
}

.user-profile-btn:hover .user-avatar {
    border-color: var(--nav-accent);
    transform: scale(1.05);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--nav-text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.user-role {
    font-size: 12px;
    color: var(--nav-text-muted);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.dropdown-arrow {
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nav-text-muted);
    transition: var(--nav-transition);
}

.modern-nav-btn[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

/* Modern Dropdowns */
.modern-dropdown {
    background: var(--nav-bg);
    border: 1px solid var(--nav-border);
    border-radius: 12px;
    box-shadow: var(--nav-shadow-lg);
    padding: 0;
    margin-top: 8px;
    min-width: 280px;
    max-width: 400px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.dropdown-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--nav-border);
    background: linear-gradient(135deg, var(--nav-bg) 0%, rgba(59, 130, 246, 0.02) 100%);
    border-radius: 12px 12px 0 0;
}

.dropdown-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--nav-text);
    margin: 0;
}

.dropdown-body {
    padding: 8px 0;
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--nav-border);
    background: var(--nav-hover-bg);
    border-radius: 0 0 12px 12px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--nav-text);
    text-decoration: none;
    transition: var(--nav-transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

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

.dropdown-item:focus {
    background: var(--nav-hover-bg);
    color: var(--nav-text);
    outline: none;
}

.item-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nav-text-muted);
    flex-shrink: 0;
}

.dropdown-item:hover .item-icon {
    color: var(--nav-accent);
}

.item-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--nav-text);
    line-height: 1.2;
}

.item-description {
    font-size: 12px;
    color: var(--nav-text-muted);
    line-height: 1.2;
    margin-top: 2px;
}

/* Notifications Dropdown */
.notifications-dropdown {
    min-width: 320px;
}

.mark-all-read {
    background: none;
    border: none;
    color: var(--nav-accent);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--nav-transition);
}

.mark-all-read:hover {
    background: rgba(59, 130, 246, 0.1);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-align: center;
}

.empty-icon {
    width: 32px;
    height: 32px;
    color: var(--nav-text-muted);
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--nav-text-muted);
    font-size: 14px;
    margin: 0;
}

.view-all-link {
    color: var(--nav-accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--nav-transition);
}

.view-all-link:hover {
    color: var(--nav-accent-hover);
}

/* User Dropdown */
.user-dropdown {
    min-width: 280px;
}

.user-profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--nav-border);
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-details .user-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--nav-text);
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.user-email {
    font-size: 12px;
    color: var(--nav-text-muted);
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.user-role-badge {
    display: inline-block;
    background: var(--nav-accent);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logout-item {
    color: var(--nav-danger) !important;
}

.logout-item:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: var(--nav-danger) !important;
}

.logout-item .item-icon {
    color: var(--nav-danger) !important;
}

/* Modern Search Modal */
.modern-search-modal {
    border: none;
    border-radius: 16px;
    box-shadow: var(--nav-shadow-lg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.search-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--nav-border);
}

.search-icon {
    width: 20px;
    height: 20px;
    color: var(--nav-text-muted);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: none;
    font-size: 16px;
    color: var(--nav-text);
    placeholder-color: var(--nav-text-muted);
}

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

.search-suggestions {
    padding: 16px 0;
}

.suggestion-group {
    margin-bottom: 24px;
}

.suggestion-group:last-child {
    margin-bottom: 0;
}

.suggestion-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--nav-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px 0;
    padding: 0 24px;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    cursor: pointer;
    transition: var(--nav-transition);
}

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

.suggestion-icon {
    width: 16px;
    height: 16px;
    color: var(--nav-text-muted);
    flex-shrink: 0;
}

.suggestion-item:hover .suggestion-icon {
    color: var(--nav-accent);
}

.search-footer {
    display: flex;
    justify-content: center;
    padding: 16px 24px;
    border-top: 1px solid var(--nav-border);
    background: var(--nav-hover-bg);
}

.search-shortcuts {
    display: flex;
    gap: 16px;
    align-items: center;
}

.shortcut {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--nav-text-muted);
}

.shortcut kbd {
    background: var(--nav-bg);
    border: 1px solid var(--nav-border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-family: monospace;
    color: var(--nav-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Modern Loading Modal */
.modern-loading-modal {
    border: none;
    border-radius: 12px;
    box-shadow: var(--nav-shadow-lg);
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    color: var(--nav-accent);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    color: var(--nav-text);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-container {
        padding: 0 16px;
    }
    
    .page-title {
        font-size: 20px;
    }
    
    .modern-nav-btn .btn-text {
        display: none;
    }
    
    .user-info {
        display: none !important;
    }
    
    .search-shortcut {
        display: none;
    }
    
    .modern-dropdown {
        min-width: 260px;
        max-width: calc(100vw - 32px);
    }
}

@media (max-width: 480px) {
    .navbar-container {
        padding: 0 12px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .navbar-right {
        gap: 4px;
    }
    
    .modern-nav-btn {
        padding: 8px;
    }
    
    .user-profile-btn {
        padding: 6px;
    }
}

/* Focus styles for accessibility */
.modern-nav-btn:focus,
.dropdown-item:focus,
.search-input:focus {
    outline: 2px solid var(--nav-accent);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --nav-border: #000000;
        --nav-text: #000000;
        --nav-bg: #ffffff;
    }
    
    [data-bs-theme="dark"] {
        --nav-border: #ffffff;
        --nav-text: #ffffff;
        --nav-bg: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* Print styles */
@media print {
    .modern-top-navbar {
        display: none;
    }
}/* Addi
tional styles for search results and notifications */
.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px 8px;
    border-bottom: 1px solid var(--nav-border);
}

.search-results-header h6 {
    font-size: 14px;
    font-weight: 600;
    color: var(--nav-text);
    margin: 0;
}

.results-count {
    font-size: 12px;
    color: var(--nav-text-muted);
}

.results-list {
    padding: 8px 0;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--nav-text);
    text-decoration: none;
    transition: var(--nav-transition);
}

.result-item:hover,
.result-item.focused {
    background: var(--nav-hover-bg);
    color: var(--nav-text);
}

.result-icon {
    width: 16px;
    height: 16px;
    color: var(--nav-text-muted);
    flex-shrink: 0;
}

.result-item:hover .result-icon {
    color: var(--nav-accent);
}

.result-content {
    flex: 1;
    min-width: 0;
}

.result-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--nav-text);
    line-height: 1.2;
    margin-bottom: 2px;
}

.result-description {
    font-size: 12px;
    color: var(--nav-text-muted);
    line-height: 1.2;
}

/* Notification items */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    position: relative;
    transition: var(--nav-transition);
    cursor: pointer;
}

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

.notification-item.unread {
    background: rgba(59, 130, 246, 0.05);
}

.notification-icon {
    width: 16px;
    height: 16px;
    color: var(--nav-text-muted);
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-icon.ticket {
    color: var(--nav-accent);
}

.notification-icon.alert {
    color: var(--nav-warning);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--nav-text);
    line-height: 1.2;
    margin-bottom: 2px;
}

.notification-message {
    font-size: 12px;
    color: var(--nav-text-muted);
    line-height: 1.3;
    margin-bottom: 4px;
}

.notification-time {
    font-size: 11px;
    color: var(--nav-text-muted);
    line-height: 1.2;
}

.unread-indicator {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 8px;
    height: 8px;
    background: var(--nav-accent);
    border-radius: 50%;
}

/* Toast notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--nav-bg);
    color: var(--nav-text);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: var(--nav-shadow-lg);
    border: 1px solid var(--nav-border);
    z-index: 1050;
    transform: translateX(100%);
    transition: var(--nav-transition);
    max-width: 300px;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification.toast-success {
    border-left: 4px solid var(--nav-success);
}

.toast-notification.toast-warning {
    border-left: 4px solid var(--nav-warning);
}

.toast-notification.toast-error {
    border-left: 4px solid var(--nav-danger);
}

.toast-notification.toast-info {
    border-left: 4px solid var(--nav-accent);
}

/* Layout adjustments for modern navigation */
.main-content {
    padding-top: 0;
}

.content-wrapper {
    padding: 24px;
    min-height: calc(100vh - var(--nav-height) - 60px); /* Account for nav height and footer */
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 16px;
    }
}