/**
 * TalkStock V2 - 通知面板樣式 (v17.5)
 * 雙模式（摘要/全部）+ 溢出選單 + 刪除功能
 */

/* ── Header 雙行 ── */
.notif-header-row1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notif-header-row1 h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.notif-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.notif-overflow-wrapper {
    position: relative;
}

.notif-overflow-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.notif-overflow-btn:hover {
    background: var(--color-bg-tertiary, rgba(0,0,0,0.04));
    color: var(--color-text-primary);
}

.notif-close-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.notif-close-btn:hover {
    background: var(--color-bg-tertiary, rgba(0,0,0,0.04));
    color: var(--color-text-primary);
}

/* ── Header Row 2: Tabs + Unread ── */
.notif-header-row2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.notif-tabs {
    display: flex;
    gap: 2px;
    background: var(--color-bg-tertiary, rgba(0,0,0,0.04));
    border-radius: 6px;
    padding: 2px;
}

.notif-tab {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.notif-tab:hover {
    color: var(--color-text-primary);
}

.notif-tab.active {
    background: var(--color-accent, #3b82f6);
    color: #fff;
}

.notif-unread-label {
    font-size: 12px;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

/* ── 溢出選單 ── */
.notif-overflow-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--color-bg-secondary, #fff);
    border: 1px solid var(--color-border-subtle, rgba(0,0,0,0.06));
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1100;
    overflow: hidden;
    min-width: 160px;
}

.notif-overflow-item {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: var(--color-text-primary);
    cursor: pointer;
    padding: 10px 16px;
    font-size: 13px;
    text-align: left;
    transition: background 0.15s;
}

.notif-overflow-item:hover {
    background: var(--color-bg-tertiary, rgba(0,0,0,0.04));
}

.notif-overflow-danger {
    color: #ef4444;
}

.notif-overflow-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ── 篩選 Pills (全部 Tab) ── */
.notif-filter-pills {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 16px 4px;
}

.notif-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.notif-filter-label {
    font-size: 11px;
    color: var(--color-text-secondary);
    min-width: 28px;
    flex-shrink: 0;
}

.notif-filter-pill {
    background: var(--color-bg-tertiary, rgba(0,0,0,0.04));
    border: 1px solid transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    transition: all 0.15s;
}

.notif-filter-pill:hover {
    color: var(--color-text-primary);
    border-color: var(--color-border-subtle, rgba(0,0,0,0.1));
}

.notif-filter-pill.active {
    background: var(--color-accent, #3b82f6);
    color: #fff;
    border-color: var(--color-accent, #3b82f6);
}

/* ── 摘要視圖: 總覽 ── */
.notif-summary-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border-subtle, rgba(0,0,0,0.06));
}

.notif-summary-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notif-summary-date {
    font-size: 12px;
    color: var(--color-text-secondary);
    font-weight: 400;
}

.notif-summary-stats {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* ── 策略卡片 ── */
.notif-strategy-card {
    margin: 8px 12px;
    padding: 12px;
    background: var(--color-bg-tertiary, rgba(0,0,0,0.02));
    border: 1px solid var(--color-border-subtle, rgba(0,0,0,0.06));
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.notif-strategy-card:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-accent, #3b82f6);
}

.notif-strategy-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.notif-strategy-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.notif-strategy-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--color-accent, #3b82f6);
}

.notif-strategy-icon svg {
    width: 16px;
    height: 16px;
}

.notif-strategy-time {
    font-size: 11px;
    color: var(--color-text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.notif-strategy-body {
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-text-secondary);
}

.notif-strategy-matched {
    margin-bottom: 4px;
}

.notif-diff-chips {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 4px;
}

.notif-diff-chip {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
}

.notif-diff-chip.added {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.notif-diff-chip.removed {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.notif-strategy-arrow {
    font-size: 11px;
    color: var(--color-text-secondary);
}

.notif-strategy-new-items {
    margin-top: 4px;
    font-size: 11px;
    color: var(--color-text-secondary);
}

.notif-strategy-runs {
    margin-top: 4px;
    font-size: 11px;
    color: var(--color-text-secondary);
    font-style: italic;
}

/* ── 其他通知 section ── */
.notif-other-section {
    padding: 8px 16px 4px;
    font-size: 12px;
    color: var(--color-text-secondary);
    border-top: 1px solid var(--color-border-subtle, rgba(0,0,0,0.06));
    margin-top: 4px;
}

/* ── 全部 Tab: hover 刪除按鈕 ── */
.notification-item {
    position: relative;
}

.notif-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
}

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

.notif-delete-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* ── 空白狀態 ── */
.notification-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-secondary);
}

.notification-empty svg {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.notification-empty p {
    margin: 0;
    font-size: 13px;
}
