/* ============================================
   ImportPanel v5.0 - Notification Center
   ============================================ */

.notifications-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 0 40px;
}

/* Page header row */
.notifications-page .page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.notif-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.notif-header-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 8px 14px;
}

.notif-header-actions .btn-icon {
    padding: 8px;
}

/* ============================================
   Preferences Popover
   ============================================ */
.notif-preferences-popover {
    position: absolute;
    top: 70px;
    right: 20px;
    width: 320px;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-lg, 10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideDown 0.2s ease;
}

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

.notif-prefs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.notif-prefs-header h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--color-text, #111827);
}

.notif-prefs-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--color-text-muted, #9ca3af);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm, 6px);
    transition: all 0.2s;
}

.notif-prefs-close:hover {
    background: var(--color-bg, #f5f7fa);
    color: var(--color-text, #111827);
}

.notif-prefs-body {
    padding: 12px 20px;
}

.notif-pref-item {
    padding: 8px 0;
}

.notif-pref-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text, #111827);
}

.notif-pref-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.notif-prefs-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--color-border, #e5e7eb);
    display: flex;
    justify-content: flex-end;
}

/* ============================================
   Stat Cards
   ============================================ */
.notif-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.notif-stat-card {
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-lg, 10px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.notif-stat-card:hover {
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.notif-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-stat-icon.all {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.notif-stat-icon.unread {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.notif-stat-icon.today {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.notif-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-muted, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notif-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text, #111827);
    line-height: 1;
}

/* ============================================
   Batch Actions Toolbar
   ============================================ */
.notif-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-lg, 10px);
    margin-bottom: 16px;
}

.notif-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.notif-checkbox-all {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text, #111827);
    padding: 4px 8px;
    border-radius: var(--radius-sm, 6px);
    transition: background 0.2s;
}

.notif-checkbox-all:hover {
    background: var(--color-bg, #f5f7fa);
}

.notif-checkbox-all input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.notif-toolbar .btn-sm {
    font-size: 12px;
    padding: 6px 12px;
}

/* ============================================
   Filters
   ============================================ */
.notif-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

/* Filter pill buttons */
.notif-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 20px;
    background: var(--color-surface, #fff);
    color: var(--color-text-secondary, #6b7280);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.notif-filter-btn:hover {
    border-color: var(--color-primary, #2563eb);
    color: var(--color-primary, #2563eb);
    background: rgba(37, 99, 235, 0.04);
}

.notif-filter-btn.active {
    background: var(--color-primary, #2563eb);
    border-color: var(--color-primary, #2563eb);
    color: #fff;
}

.notif-filter-btn .notif-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
}

.notif-filter-btn.active .notif-filter-count {
    background: rgba(255, 255, 255, 0.25);
}

.notif-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.notif-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted, #9ca3af);
    pointer-events: none;
}

.notif-search-wrapper .form-input {
    padding-left: 36px;
    height: 38px;
    width: 100%;
    font-size: 13px;
    border-radius: 20px;
    transition: all 0.2s;
}

.notif-search-wrapper .form-input:focus {
    border-color: var(--color-primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ============================================
   Notification Groups
   ============================================ */
.notif-group {
    margin-bottom: 24px;
}

.notif-group-header {
    margin-bottom: 12px;
}

.notif-group-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-md, 8px);
    transition: background 0.2s;
    width: 100%;
}

.notif-group-toggle:hover {
    background: var(--color-bg, #f5f7fa);
}

.notif-group-chevron {
    transition: transform 0.2s;
    color: var(--color-text-muted, #9ca3af);
    flex-shrink: 0;
}

.notif-group.collapsed .notif-group-chevron {
    transform: rotate(-90deg);
}

.notif-group-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text, #111827);
    margin: 0;
    text-align: left;
}

.notif-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    background: var(--color-bg, #f5f7fa);
    color: var(--color-text-secondary, #6b7280);
}

.notif-group-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s;
}

.notif-group.collapsed .notif-group-content {
    display: none;
}

/* ============================================
   Notification List
   ============================================ */
.notif-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Loading state */
.notif-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-muted, #9ca3af);
    font-size: 14px;
}

/* Empty state */
.notif-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted, #9ca3af);
}

.notif-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-secondary, #6b7280);
    margin-bottom: 4px;
}

.notif-empty-desc {
    font-size: 13px;
    color: var(--color-text-muted, #9ca3af);
}

/* Illustrated notification empty state */
.notif-empty-illustrated {
    padding: 40px 20px;
}

.notif-empty-illustrated .empty-state-enhanced {
    padding: 20px 0;
}

/* ============================================
   Notification Card
   ============================================ */
.notif-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-lg, 10px);
    transition: all 0.2s ease;
    cursor: default;
    position: relative;
}

.notif-card[data-link] {
    cursor: pointer;
}

/* Checkbox (visible on hover or when selected) */
.notif-checkbox {
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    margin: 0;
}

.notif-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.notif-card:hover .notif-checkbox,
.notif-card.selected .notif-checkbox {
    opacity: 1;
}

/* Left accent bar by notification type */
.notif-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: var(--radius-lg, 10px) 0 0 var(--radius-lg, 10px);
}

.notif-accent-status,
.notif-accent-system {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}

.notif-accent-eta {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

.notif-accent-payment {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}

.notif-accent-comment {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

/* Selected state */
.notif-card.selected {
    background: rgba(37, 99, 235, 0.04);
    border-color: var(--color-primary, #2563eb);
}

/* Unread state: subtle blue tint + bold title */
.notif-card.unread {
    background: rgba(37, 99, 235, 0.02);
}

.notif-card.unread .notif-title {
    font-weight: 700;
}

/* Unread dot indicator */
.notif-card.unread::after {
    content: '';
    position: absolute;
    top: 18px;
    right: 16px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.notif-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.notif-card.unread:hover {
    background: rgba(37, 99, 235, 0.04);
}

/* Icon */
.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-icon.eta {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.notif-icon.status {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.notif-icon.payment {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.notif-icon.comment {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.notif-icon.system {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* Content */
.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text, #111827);
    margin-bottom: 2px;
    line-height: 1.4;
}

.notif-desc {
    font-size: 13px;
    color: var(--color-text-secondary, #6b7280);
    line-height: 1.4;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notif-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

/* Modern pill-shaped category badges */
.notif-type-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.4;
}

.notif-type-badge.eta {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.notif-type-badge.status {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.notif-type-badge.payment {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.notif-type-badge.comment {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.notif-type-badge.system {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* Timestamp: muted, smaller, aligned right */
.notif-time {
    font-size: 11px;
    color: var(--color-text-muted, #9ca3af);
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Actions */
.notif-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.notif-card:hover .notif-actions {
    opacity: 1;
}

.notif-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm, 6px);
    color: var(--color-text-muted, #9ca3af);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.notif-action-btn:hover {
    background: var(--color-bg, #f5f7fa);
    color: var(--color-text, #111827);
}

.notif-btn-read:hover {
    color: var(--color-primary, #2563eb);
    background: rgba(37, 99, 235, 0.08);
}

.notif-btn-unread:hover {
    color: var(--color-warning, #d97706);
    background: rgba(245, 158, 11, 0.08);
}

.notif-btn-delete:hover {
    color: var(--color-danger, #dc2626);
    background: rgba(239, 68, 68, 0.08);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .notifications-page {
        padding: 0 0 80px;
    }

    .notifications-page .page-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .notif-header-actions {
        width: 100%;
    }

    .notif-header-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .notif-preferences-popover {
        right: 10px;
        left: 10px;
        width: auto;
    }

    .notif-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .notif-stat-card {
        flex-direction: row;
        align-items: center;
        padding: 14px 16px;
        gap: 12px;
    }

    .notif-stat-icon {
        width: 36px;
        height: 36px;
    }

    .notif-stat-value {
        font-size: 22px;
        margin-left: auto;
    }

    .notif-stat-label {
        font-size: 11px;
    }

    .notif-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .notif-toolbar-left {
        flex-direction: column;
        gap: 8px;
    }

    .notif-toolbar .btn-sm {
        width: 100%;
        justify-content: center;
    }

    .notif-filters {
        flex-wrap: wrap;
    }

    .notif-filter-btn {
        font-size: 11px;
        padding: 5px 12px;
    }

    .notif-search-wrapper {
        width: 100%;
    }

    .notif-group-title {
        font-size: 14px;
    }

    .notif-card {
        padding: 12px;
        gap: 10px;
    }

    .notif-card.unread::after {
        top: 14px;
        right: 12px;
    }

    .notif-icon {
        width: 36px;
        height: 36px;
    }

    /* Always show checkbox and actions on mobile */
    .notif-checkbox {
        opacity: 1;
    }

    .notif-actions {
        opacity: 1;
    }

    .notif-title {
        font-size: 13px;
    }

    .notif-desc {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .notif-icon {
        display: none;
    }

    .notif-card {
        gap: 8px;
    }

    .notif-filter-btn {
        flex: 1;
        justify-content: center;
    }
}
