/**
 * Real-time Notifications Styles
 * Toast notifications and notification bell icon
 */

/* ============================================
   Toast Notifications Container
   ============================================ */

.notification-toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

/* ============================================
   Toast Notification Card
   ============================================ */

.notification-toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    position: relative;
    border-left: 4px solid #3b82f6;
}

.notification-toast-success {
    border-left-color: #10b981;
}

.notification-toast-error {
    border-left-color: #ef4444;
}

.notification-toast-info {
    border-left-color: #3b82f6;
}

.notification-toast.fade-out {
    animation: slideOut 0.3s ease-in;
    opacity: 0;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Toast Icon */
.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

/* Toast Content */
.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast-message {
    color: #1f2937;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.toast-preview {
    margin-top: 8px;
}

.toast-preview img {
    max-width: 100%;
    max-height: 120px;
    border-radius: 4px;
    object-fit: cover;
}

.toast-link {
    color: #3b82f6;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.toast-link:hover {
    text-decoration: underline;
}

/* Toast Close Button */
.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 20px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.toast-close:hover {
    color: #4b5563;
}

/* ============================================
   Notification Bell Icon
   ============================================ */

.notification-bell {
    position: relative;
    margin-right: 20px;
}

.notification-bell-btn {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.notification-bell-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.bell-icon {
    font-size: 24px;
    display: block;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* ============================================
   Notification Dropdown
   ============================================ */

.notification-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 380px;
    max-height: 500px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 1000;
}

.notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.notification-dropdown-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.notification-clear-btn {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
}

.notification-clear-btn:hover {
    text-decoration: underline;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* ============================================
   Notification Item
   ============================================ */

.notification-item {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
}

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

.notification-item:last-child {
    border-bottom: none;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.notification-operation {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

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

.notification-status {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
    text-transform: capitalize;
}

.notification-error {
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
}

.notification-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.notification-link:hover {
    text-decoration: underline;
}

/* Status-specific colors */
.notification-success .notification-operation {
    color: #10b981;
}

.notification-error .notification-operation {
    color: #ef4444;
}

.notification-info .notification-operation {
    color: #3b82f6;
}

/* ============================================
   Mobile Responsive
   ============================================ */

@media (max-width: 768px) {
    .notification-toast-container {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .notification-dropdown {
        width: 320px;
        max-width: calc(100vw - 20px);
    }
}
