/**
 * Notification System Styles
 */

/* Notification Bell */
#notificationBell {
    position: relative;
}

#notificationBellToggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    color: #363636;
    text-decoration: none;
    transition: all 0.3s ease;
}

#notificationBellToggle:hover {
    color: #d39e00;
    text-decoration: none;
}

#notificationBellToggle .icon-bell {
    font-size: 20px;
}

#notificationBadge {
    position: absolute;
    top: 5px;
    right: 5px;
    min-width: 18px;
    height: 18px;
    padding: 2px 5px;
    font-size: 10px;
    font-weight: bold;
    line-height: 14px;
    text-align: center;
    background-color: #dc3545;
    border-radius: 10px;
    color: #fff;
}

/* Notification Drawer */
.notification-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.notification-drawer.open {
    right: 0;
}

/* Drawer Header */
.notification-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.notification-drawer-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.notification-drawer-actions {
    display: flex;
    gap: 10px;
}

.notification-drawer-actions .btn {
    padding: 5px 10px;
    color: #666;
    transition: color 0.2s;
}

.notification-drawer-actions .btn:hover {
    color: #333;
}

/* Drawer Body */
.notification-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Notification Item */
.notification-item {
    display: flex;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    background-color: #e7f3ff;
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #007bff;
}

.notification-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 15px;
    font-size: 18px;
}

.notification-icon-info {
    background-color: #e3f2fd;
    color: #2196f3;
}

.notification-icon-success {
    background-color: #e8f5e9;
    color: #4caf50;
}

.notification-icon-warning {
    background-color: #fff3e0;
    color: #ff9800;
}

.notification-icon-danger {
    background-color: #ffebee;
    color: #f44336;
}

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

.notification-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.notification-message {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notification-time {
    font-size: 12px;
    color: #999;
}

/* Loading, Empty, and Error States */
.notification-loading,
.notification-empty,
.notification-error {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.notification-loading i {
    font-size: 24px;
    margin-bottom: 10px;
}

.notification-error {
    color: #dc3545;
}

/* Overlay */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
    .notification-drawer {
        width: 100%;
        right: -100%;
    }
}

/* Scrollbar Styles */
.notification-drawer-body::-webkit-scrollbar {
    width: 6px;
}

.notification-drawer-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.notification-drawer-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.notification-drawer-body::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Animation for new notifications */
@keyframes notificationPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.notification-bell-pulse {
    animation: notificationPulse 0.5s ease-in-out;
}

/* Notification Arrow for clickable items */
.notification-arrow {
    display: flex;
    align-items: center;
    color: #999;
    margin-left: 10px;
}

.notification-item.clickable:hover .notification-arrow {
    color: #333;
}

/* Notification Detail Modal */
.notification-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1060;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.notification-detail-modal.open {
    opacity: 1;
    visibility: visible;
}

.notification-detail-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.notification-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.notification-detail-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.notification-detail-header .btn {
    padding: 5px 10px;
    color: #666;
}

.notification-detail-header .btn:hover {
    color: #333;
}

.notification-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.notification-detail-info {
    margin-bottom: 20px;
}

.notification-detail-info p {
    margin: 10px 0;
    font-size: 14px;
    color: #666;
}

.notification-detail-info strong {
    color: #333;
    font-weight: 600;
}

/* Job Logs Timeline */
.job-logs-timeline {
    margin-top: 20px;
    border-top: 1px solid #e9ecef;
    padding-top: 20px;
}

.job-logs-timeline h5 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.job-logs-container {
    max-height: 400px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
}

/* Job Log Entry */
.job-log-entry {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 10px;
    background: #fff;
    border-radius: 6px;
    border-left: 3px solid #ddd;
    transition: all 0.2s ease;
    animation: logSlideIn 0.3s ease;
}

@keyframes logSlideIn {
    from {
        transform: translateX(-10px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.job-log-entry:last-child {
    margin-bottom: 0;
}

.job-log-time {
    font-size: 11px;
    color: #999;
    margin-right: 10px;
    white-space: nowrap;
    font-family: monospace;
}

.job-log-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 10px;
    font-size: 12px;
}

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

.job-log-message {
    font-size: 13px;
    color: #333;
    line-height: 1.5;
    word-wrap: break-word;
}

.job-log-context {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-family: monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Log Level Colors */
.job-log-info {
    border-left-color: #2196f3;
}

.job-log-info .job-log-icon {
    background-color: #e3f2fd;
    color: #2196f3;
}

.job-log-success {
    border-left-color: #4caf50;
}

.job-log-success .job-log-icon {
    background-color: #e8f5e9;
    color: #4caf50;
}

.job-log-warning {
    border-left-color: #ff9800;
}

.job-log-warning .job-log-icon {
    background-color: #fff3e0;
    color: #ff9800;
}

.job-log-danger {
    border-left-color: #f44336;
}

.job-log-danger .job-log-icon {
    background-color: #ffebee;
    color: #f44336;
}

.job-log-secondary {
    border-left-color: #9e9e9e;
}

.job-log-secondary .job-log-icon {
    background-color: #f5f5f5;
    color: #9e9e9e;
}

/* Empty state for logs */
.job-log-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

/* Scrollbar Styles for logs */
.job-logs-container::-webkit-scrollbar {
    width: 6px;
}

.job-logs-container::-webkit-scrollbar-track {
    background: #e9ecef;
}

.job-logs-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.job-logs-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsive */
@media (max-width: 768px) {
    .notification-detail-content {
        width: 95%;
        max-height: 90vh;
    }

    .job-log-entry {
        flex-direction: column;
        align-items: flex-start;
    }

    .job-log-time {
        margin-bottom: 5px;
    }
}
