/**
 * Notification System Styles
 * Bell icon, dropdown panel, and toast notifications
 */

/* ============================================================================
   Bell Button Wrapper
   ============================================================================ */
.notification-bell-wrapper {
    position: relative;
    display: inline-flex;
}

/* ============================================================================
   Bell Button
   ============================================================================ */
.notification-bell-btn {
    position: relative;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    background-color: rgba(75, 85, 99, 1); /* gray-600 */
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-bell-btn:hover {
    background-color: rgba(55, 65, 81, 1); /* gray-700 */
}

@media (min-width: 640px) {
    .notification-bell-btn {
        padding: 0.5rem;
    }
}

/* ============================================================================
   Badge
   ============================================================================ */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    color: white;
    background-color: #ef4444; /* red-500 */
    border-radius: 9999px;
    animation: notification-badge-pop 0.3s ease-out;
}

@keyframes notification-badge-pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ============================================================================
   Dropdown Panel
   ============================================================================ */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 20px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    overflow: hidden;
    animation: notification-dropdown-in 0.2s ease-out;
}

.notification-dropdown.hidden {
    display: none;
}

@keyframes notification-dropdown-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(to right, #f9fafb, #f3f4f6);
}

.notification-dropdown-title {
    font-weight: 700;
    font-size: 14px;
    color: #0a2540;
}

.notification-mark-all-btn {
    font-size: 12px;
    font-weight: 600;
    color: #3b82f6;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.notification-mark-all-btn:hover {
    background-color: #eff6ff;
}

/* Notification List */
.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

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

/* Notification Item */
.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background-color 0.15s;
    position: relative;
}

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

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

/* Unread indicator */
.notification-item-unread {
    background-color: #eff6ff;
    border-left: 3px solid #3b82f6;
}

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

/* Pinned indicator */
.notification-item-pinned {
    background-color: #fefce8;
    border-left: 3px solid #eab308;
}

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

.notification-item-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.notification-item-icon {
    width: 20px;
    height: 20px;
    color: #6b7280;
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-item-unread .notification-item-icon {
    color: #3b82f6;
}

.notification-item-pinned .notification-item-icon {
    color: #eab308;
}

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

.notification-item-title {
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
    margin-bottom: 2px;
}

.notification-item-message {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-item-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Dismiss button */
.notification-dismiss-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s, background-color 0.15s;
}

.notification-item:hover .notification-dismiss-btn {
    opacity: 1;
}

.notification-dismiss-btn:hover {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* Footer */
.notification-dropdown-footer {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    text-align: center;
}

.notification-view-all {
    font-size: 13px;
    font-weight: 600;
    color: #3b82f6;
    text-decoration: none;
}

.notification-view-all:hover {
    text-decoration: underline;
}

/* ============================================================================
   Toast Container
   ============================================================================ */
.notification-toast-container {
    position: fixed;
    top: 80px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

@media (max-width: 640px) {
    .notification-toast-container {
        top: 70px;
        right: 8px;
        left: 8px;
    }
}

/* ============================================================================
   Toast Item
   ============================================================================ */
.notification-toast {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    pointer-events: auto;
    max-width: 380px;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s, transform 0.3s;
}

@media (max-width: 640px) {
    .notification-toast {
        max-width: 100%;
    }
}

.notification-toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.notification-toast-hiding {
    opacity: 0;
    transform: translateX(100%);
}

.notification-toast-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    cursor: pointer;
}

.notification-toast-icon {
    width: 20px;
    height: 20px;
    color: #3b82f6;
    flex-shrink: 0;
    margin-top: 2px;
}

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

.notification-toast-title {
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
    margin-bottom: 2px;
}

.notification-toast-message {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-toast-close {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.15s, color 0.15s;
}

.notification-toast-close:hover {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* ============================================================================
   Priority Colors (optional enhancement)
   ============================================================================ */
.notification-item[data-priority="1"] .notification-item-icon,
.notification-item[data-priority="2"] .notification-item-icon {
    color: #ef4444;
}

.notification-toast[data-priority="1"],
.notification-toast[data-priority="2"] {
    border-left: 4px solid #ef4444;
}
