/* Top Bar Styles */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    padding: 0;
    margin-bottom: 0;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.98);
}

.top-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 70px;
    max-width: 100%;
}

.top-bar-left {
    flex: 1;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Notification Bell in Top Bar */
.top-bar-right .notification-center {
    position: relative;
    display: inline-block;
}

.top-bar-right .notification-bell-btn {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
}

.top-bar-right .notification-bell-btn:hover {
    background: #f8f9fa;
}

.top-bar-right .notification-bell {
    font-size: 20px;
    color: #6c757d;
    transition: color 0.2s ease;
}

.top-bar-right .notification-bell-btn:hover .notification-bell {
    color: #495057;
}

.top-bar-right .notification-bell.has-notifications {
    color: #ff9800 !important;
}

.top-bar-right .notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: #f46a6a;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1.2;
}

.top-bar-right .notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    margin-top: 0;
    width: 380px;
    max-height: 500px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 10000;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.top-bar-right .notification-dropdown.show {
    display: flex;
    animation: slideDown 0.2s ease-out;
}

.top-bar-right .notification-dropdown-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.top-bar-right .notification-dropdown-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
}

.top-bar-right .mark-all-read-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6c757d;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.top-bar-right .mark-all-read-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.top-bar-right .notification-dropdown-body {
    flex: 1;
    overflow-y: auto;
    max-height: 350px;
    padding: 8px 0;
}

.top-bar-right .notification-dropdown-body::-webkit-scrollbar {
    width: 6px;
}

.top-bar-right .notification-dropdown-body::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.top-bar-right .notification-dropdown-body::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

.top-bar-right .notification-dropdown-body::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.top-bar-right .notification-loading {
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.top-bar-right .notification-loading i {
    font-size: 32px;
    color: #556ee6;
    margin-bottom: 12px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.top-bar-right .notification-loading p {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
}

.top-bar-right .no-notifications {
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.top-bar-right .no-notifications i {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 12px;
    display: block;
}

.top-bar-right .no-notifications p {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
}

.top-bar-right .notification-dropdown-footer {
    padding: 12px 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.top-bar-right .show-all-btn {
    width: 100%;
    background: transparent;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.top-bar-right .show-all-btn:hover {
    background: #ffffff;
    border-color: #adb5bd;
    color: #212529;
}

/* Notification items in top bar dropdown */
.top-bar-right .notification-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.top-bar-right .notification-item:hover {
    background-color: #f8f9fa;
}

.top-bar-right .notification-item.unread {
    background-color: #fff3e0;
}

.top-bar-right .notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #ff9800;
}

.top-bar-right .notification-item-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.top-bar-right .notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff3cd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff9800;
    font-size: 18px;
    flex-shrink: 0;
}

.top-bar-right .notification-content {
    flex: 1;
}

.top-bar-right .notification-title {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 4px 0;
}

.top-bar-right .notification-message {
    font-size: 13px;
    color: #6c757d;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.top-bar-right .notification-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #868e96;
    flex-wrap: wrap;
}

.top-bar-right .notification-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.top-bar-right .notification-severity {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.top-bar-right .notification-severity.critical {
    background: #fee;
    color: #d32f2f;
}

.top-bar-right .notification-severity.high {
    background: #fff3e0;
    color: #f57c00;
}

.top-bar-right .notification-severity.medium {
    background: #fff9c4;
    color: #f9a825;
}

.top-bar-right .notification-severity.low {
    background: #e8f5e9;
    color: #388e3c;
}

/* Profile Modal */
.profile-modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.profile-modal-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.profile-modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid #e5e9f2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fc;
    border-radius: 12px 12px 0 0;
}

.profile-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2f3a4f;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-modal-header h2 i {
    color: #556ee6;
}

.profile-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #74788d;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.profile-modal-close:hover {
    background: #e5e9f2;
    color: #2f3a4f;
}

.profile-modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

.profile-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #74788d;
}

.profile-loading i {
    font-size: 32px;
    color: #556ee6;
    margin-bottom: 12px;
}

.profile-loading p {
    margin: 0;
    font-size: 14px;
}

.profile-form-group {
    margin-bottom: 20px;
}

.profile-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #2f3a4f;
}

.profile-form-group label .required {
    color: #dc3545;
}

.profile-form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e9f2;
    border-radius: 8px;
    font-size: 14px;
    color: #2f3a4f;
    transition: all 0.2s;
    box-sizing: border-box;
}

.profile-form-control:focus {
    outline: none;
    border-color: #556ee6;
    box-shadow: 0 0 0 3px rgba(85, 110, 230, 0.1);
}

.profile-form-control:read-only {
    background-color: #f8f9fc;
    cursor: not-allowed;
}

.profile-error {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #c33;
    font-size: 14px;
}

.profile-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #155724;
    font-size: 14px;
}

.profile-modal-footer {
    padding: 20px 28px;
    border-top: 1px solid #e5e9f2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    background: #f8f9fc;
    border-radius: 0 0 12px 12px;
}

.profile-modal-footer .btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.profile-modal-footer .btn-secondary {
    background: #e5e9f2;
    color: #2f3a4f;
}

.profile-modal-footer .btn-secondary:hover {
    background: #d5dae7;
}

.profile-modal-footer .btn-primary {
    background: #556ee6;
    color: #ffffff;
}

.profile-modal-footer .btn-primary:hover {
    background: #4a5fd4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(85, 110, 230, 0.3);
}

.profile-modal-footer .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Language Selector */
.language-selector {
    position: relative;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    color: #495057;
    font-weight: 500;
    height: 40px;
}

.language-btn:hover {
    background: #f8f9fa;
}

.language-btn:hover {
    background: #e9ecef;
    color: #212529;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.language-btn:active {
    transform: translateY(0);
}

.flag-icon {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: inline-block;
    vertical-align: middle;
}

.flag-emoji {
    font-size: 20px;
    line-height: 1;
    display: inline-block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.language-arrow {
    font-size: 10px;
    color: #6c757d;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 4px;
    opacity: 0.7;
}

.language-btn:hover .language-arrow {
    color: #495057;
    opacity: 1;
}

.language-dropdown.show ~ .language-btn .language-arrow,
.language-btn.active .language-arrow {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    overflow: hidden;
    padding: 4px 0;
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
    color: #212529;
    font-weight: 400;
    border-radius: 0;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.language-option:hover {
    background: #f8f9fa;
}

.language-option .flag-icon {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.language-option .flag-emoji {
    font-size: 20px;
    line-height: 1;
    display: inline-block;
    flex-shrink: 0;
}

/* Profile Dropdown */
.profile-dropdown-container {
    position: relative;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px 6px 14px;
    background: #f8f9fa;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    color: #495057;
    height: 40px;
}

.profile-btn:hover {
    background: #e9ecef;
    color: #212529;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.profile-btn:active {
    transform: translateY(0);
}

.profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    border: 2px solid #ffffff;
}

.profile-avatar .avatar-letter {
    display: block;
    line-height: 1;
}

.profile-avatar i {
    font-size: 18px;
}

.profile-name {
    font-weight: 500;
    color: #212529;
    white-space: nowrap;
    font-size: 14px;
    text-transform: lowercase;
}

.profile-arrow {
    font-size: 10px;
    color: #6c757d;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 4px;
}

.profile-btn:hover .profile-arrow {
    color: #495057;
}

.profile-dropdown.show ~ .profile-btn .profile-arrow,
.profile-btn.active .profile-arrow {
    transform: rotate(180deg);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    overflow: hidden;
    padding: 0;
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.profile-dropdown-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #ffffff;
    border-bottom: 1px solid #e9ecef;
}

.profile-dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 600;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}

.profile-dropdown-avatar .avatar-letter {
    display: block;
    line-height: 1;
    font-weight: 700;
}

.profile-dropdown-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-dropdown-name {
    font-weight: 600;
    font-size: 14px;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    text-transform: lowercase;
}

.profile-dropdown-email {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #212529;
    text-decoration: none;
    transition: background 0.2s ease;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    border-radius: 0;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: relative;
}

.profile-dropdown-item:hover {
    background: #f8f9fa;
}

.profile-dropdown-item i {
    width: 18px;
    text-align: center;
    color: #6c757d;
    font-size: 16px;
    flex-shrink: 0;
}

.profile-dropdown-item span {
    flex: 1;
}

.profile-dropdown-item.logout-item {
    color: #212529;
}

.profile-dropdown-item.logout-item:hover {
    background: #f8f9fa;
}

.profile-dropdown-item.logout-item i {
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .top-bar-content {
        padding: 0 20px;
        height: 60px;
    }
    
    .profile-name {
        display: none;
    }
    
    .profile-btn {
        padding: 6px;
        gap: 8px;
    }
    
    .language-btn {
        padding: 8px 12px;
    }
    
    .language-btn .flag-emoji {
        display: inline-block;
    }
    
    .profile-dropdown {
        min-width: 240px;
        right: -10px;
    }
    
    .language-dropdown {
        min-width: 160px;
        left: 0;
    }
}

/* Ensure dropdowns appear above other content */
.top-bar {
    position: relative;
}

.language-selector {
    position: relative;
}

.profile-dropdown {
    position: absolute;
}

