/**
 * Notifications Center CSS
 *
 * Compatível com temas SPA (escuros) e legado (claro)
 * Usa alta especificidade para sobrescrever estilos do tema
 *
 * @package TUH_Account
 * @since 4.0.0
 */

/* ============================================
   NOTIFICATIONS PAGE CONTAINER
   ============================================ */

.tuh-notifications-center {
    --tuh-nc-primary: var(--tuh-primary, var(--tuh-account-primary, #8C52FF));
    --tuh-nc-primary-hover: var(--tuh-primary-hover, var(--tuh-account-primary-hover, #7040d9));
    --tuh-nc-text: var(--tuh-text-primary, var(--tuh-account-text, #111827));
    --tuh-nc-text-secondary: var(--tuh-text-secondary, var(--tuh-account-text-light, #4b5563));
    --tuh-nc-text-muted: var(--tuh-text-muted, var(--tuh-account-text-muted, #6b7280));
    --tuh-nc-border: var(--tuh-card-border, var(--tuh-account-border, #e5e7eb));
    --tuh-nc-bg: var(--tuh-card-bg, var(--tuh-account-card-bg, #ffffff));
    --tuh-nc-bg-hover: var(--tuh-bg-secondary, var(--tuh-account-bg, #f9fafb));
    --tuh-nc-radius: var(--tuh-radius, var(--tuh-account-radius, 12px));
    --tuh-nc-danger: var(--tuh-danger, var(--tuh-account-danger, #ef4444));
    --tuh-nc-success: var(--tuh-success, var(--tuh-account-success, #10b981));
    --tuh-nc-warning: var(--tuh-warning, var(--tuh-account-warning, #f59e0b));
    --tuh-nc-shadow-sm: var(--tuh-shadow-sm, var(--tuh-account-shadow, 0 2px 8px rgba(15, 23, 42, 0.06)));
    --tuh-nc-shadow-lg: var(--tuh-shadow-lg, var(--tuh-account-shadow-lg, 0 8px 24px rgba(15, 23, 42, 0.12)));
    --tuh-nc-border-soft: rgba(229, 231, 235, 0.7);
    --tuh-nc-border-soft: color-mix(in srgb, var(--tuh-nc-border) 70%, transparent);
}

.tuh-notifications-center .tuh-notifications-page {
    max-width: 100%;
    width: 100%;
    margin: 0;
}

/* ============================================
   HEADER
   ============================================ */

.tuh-notifications-center .tuh-notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tuh-nc-border);
    flex-wrap: wrap;
}

.tuh-notifications-center .tuh-notifications-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0;
}

.tuh-notifications-center .tuh-notifications-title h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--tuh-nc-text) !important;
    letter-spacing: -0.01em;
}

.tuh-notifications-center .tuh-notifications-title h2 svg {
    color: var(--tuh-nc-primary);
    width: 24px;
    height: 24px;
}

.tuh-notifications-center .tuh-unread-count,
.tuh-notifications-center .tuh-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 24px;
    height: 24px;
    padding: 0 10px;
    background: var(--tuh-nc-primary) !important;
    color: #fff !important;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 999px;
}

.tuh-notifications-center .tuh-notifications-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================
   BUTTONS — SPA selector (.tuh-section prefix) beats spa-classic reset:
   html body .tuh-spa-wrapper .tuh-async-dashboard button (0,2,3)
   .tuh-section .tuh-notifications-center .tuh-btn → 0,3,0
   Classic selector (.tuh-notifications-center only) works because SPA reset doesn't apply
   ============================================ */

.tuh-notifications-center .tuh-btn,
.tuh-section .tuh-notifications-center .tuh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
}

.tuh-notifications-center .tuh-btn-secondary,
.tuh-section .tuh-notifications-center .tuh-btn-secondary {
    background: var(--tuh-nc-bg) !important;
    background-color: var(--tuh-nc-bg) !important;
    color: var(--tuh-nc-text) !important;
    border: 1px solid var(--tuh-nc-border) !important;
}

.tuh-notifications-center .tuh-btn-secondary:hover,
.tuh-section .tuh-notifications-center .tuh-btn-secondary:hover {
    background: var(--tuh-nc-bg-hover) !important;
    background-color: var(--tuh-nc-bg-hover) !important;
    border-color: var(--tuh-nc-primary) !important;
    color: #fff !important;
}

.tuh-notifications-center .tuh-btn-sm,
.tuh-section .tuh-notifications-center .tuh-btn-sm {
    padding: 8px 14px;
    font-size: 0.8125rem;
}

.tuh-notifications-center .tuh-btn svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   FILTERS
   ============================================ */

.tuh-notifications-center .tuh-notifications-filters {
    margin-bottom: 14px;
    padding: 10px 12px;
    background: var(--tuh-nc-bg) !important;
    border: 1px solid var(--tuh-nc-border) !important;
    border-radius: var(--tuh-nc-radius);
}

.tuh-notifications-center .tuh-filter-form {
    display: flex;
    gap: 10px 14px;
    flex-wrap: wrap;
    align-items: center;
}

.tuh-notifications-center .tuh-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

.tuh-notifications-center .tuh-filter-group label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--tuh-nc-text-muted) !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tuh-notifications-center .tuh-filter-group select {
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid var(--tuh-nc-border) !important;
    background: var(--tuh-nc-bg) !important;
    color: var(--tuh-nc-text) !important;
    font-size: 0.82rem;
    min-height: 36px;
    cursor: pointer;
}

.tuh-notifications-center .tuh-filter-group select:focus {
    outline: none;
    border-color: var(--tuh-nc-primary) !important;
    box-shadow: 0 0 0 3px rgba(140, 82, 255, 0.2);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tuh-nc-primary) 20%, transparent);
}

.tuh-notifications-center .tuh-filter-group select option {
    background: var(--tuh-nc-bg);
    color: var(--tuh-nc-text);
}

/* ============================================
   NOTIFICATIONS LIST
   ============================================ */

.tuh-notifications-center .tuh-notifications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================
   NOTIFICATION ITEM (HIGH SPECIFICITY)
   ============================================ */

html body .tuh-spa .tuh-notifications-center .tuh-notification-item,
.tuh-notifications-center .tuh-notification-item {
    display: flex;
    gap: 16px;
    padding: 16px 18px;
    background: var(--tuh-nc-bg) !important;
    border: 1px solid var(--tuh-nc-border) !important;
    border-radius: var(--tuh-nc-radius);
    transition: all 0.2s ease;
    align-items: flex-start;
    min-width: 0;
    width: 100%;
}

html body .tuh-spa .tuh-notifications-center .tuh-notification-item:hover,
.tuh-notifications-center .tuh-notification-item:hover {
    background: var(--tuh-nc-bg-hover) !important;
    border-color: var(--tuh-nc-border-soft) !important;
}

html body .tuh-spa .tuh-notifications-center .tuh-notification-item.unread,
.tuh-notifications-center .tuh-notification-item.unread {
    background: rgba(140, 82, 255, 0.08) !important;
    background: color-mix(in srgb, var(--tuh-nc-primary) 8%, var(--tuh-nc-bg)) !important;
    border-left: 3px solid var(--tuh-nc-primary) !important;
}

html body .tuh-spa .tuh-notifications-center .tuh-notification-item.unread:hover,
.tuh-notifications-center .tuh-notification-item.unread:hover {
    background: rgba(140, 82, 255, 0.12) !important;
    background: color-mix(in srgb, var(--tuh-nc-primary) 12%, var(--tuh-nc-bg)) !important;
}

/* ============================================
   NOTIFICATION ICON
   ============================================ */

.tuh-notifications-center .tuh-notification-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

.tuh-notifications-center .tuh-notification-icon svg {
    width: 22px;
    height: 22px;
}

/* ============================================
   NOTIFICATION CONTENT
   ============================================ */

.tuh-notifications-center .tuh-notification-content {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.tuh-notifications-center .tuh-notification-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 4px;
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
    max-width: 100%;
}

html body .tuh-spa .tuh-notifications-center .tuh-notification-title,
.tuh-notifications-center .tuh-notification-title {
    font-weight: 600;
    color: var(--tuh-nc-text) !important;
    font-size: 0.92rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
    display: block;
    width: 100%;
    word-break: normal;
}

html body .tuh-spa .tuh-notifications-center .tuh-notification-time,
.tuh-notifications-center .tuh-notification-time {
    color: var(--tuh-nc-text-secondary) !important;
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1;
    margin-top: 1px;
    white-space: nowrap;
    flex-shrink: 0;
}

html body .tuh-spa .tuh-notifications-center .tuh-notification-message,
.tuh-notifications-center .tuh-notification-message {
    color: var(--tuh-nc-text-secondary) !important;
    font-size: 0.85rem;
    margin: 0 0 8px 0;
    line-height: 1.5;
    overflow-wrap: anywhere;
    display: block;
    width: 100%;
    word-break: normal;
}

.tuh-notifications-center .tuh-notification-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--tuh-nc-primary) !important;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    overflow-wrap: anywhere;
}

.tuh-notifications-center .tuh-notification-action:hover {
    color: var(--tuh-nc-primary-hover, var(--tuh-nc-primary)) !important;
    text-decoration: none;
}

.tuh-notifications-center .tuh-notification-action svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   NOTIFICATION ACTIONS (BUTTONS)
   ============================================ */

.tuh-notifications-center .tuh-notification-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    align-self: center;
}

.tuh-notifications-center .tuh-btn-icon,
.tuh-section .tuh-notifications-center .tuh-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--tuh-nc-bg) !important;
    background-color: var(--tuh-nc-bg) !important;
    border: 1px solid var(--tuh-nc-border-soft) !important;
    border-radius: 7px;
    color: var(--tuh-nc-text-secondary) !important;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.tuh-notifications-center .tuh-btn-icon:hover,
.tuh-section .tuh-notifications-center .tuh-btn-icon:hover {
    background: var(--tuh-nc-bg-hover) !important;
    background-color: var(--tuh-nc-bg-hover) !important;
    border-color: var(--tuh-nc-border) !important;
    color: var(--tuh-nc-text) !important;
}

.tuh-notifications-center .tuh-btn-icon svg {
    width: 15px;
    height: 15px;
}

.tuh-notifications-center .tuh-btn-icon.tuh-mark-read:hover,
.tuh-section .tuh-notifications-center .tuh-btn-icon.tuh-mark-read:hover {
    background: rgba(16, 185, 129, 0.12) !important;
    background: color-mix(in srgb, var(--tuh-nc-success) 12%, var(--tuh-nc-bg)) !important;
    background-color: color-mix(in srgb, var(--tuh-nc-success) 12%, var(--tuh-nc-bg)) !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
    border-color: color-mix(in srgb, var(--tuh-nc-success) 35%, var(--tuh-nc-border)) !important;
    color: var(--tuh-nc-success) !important;
}

.tuh-notifications-center .tuh-btn-icon.tuh-delete-notification:hover,
.tuh-section .tuh-notifications-center .tuh-btn-icon.tuh-delete-notification:hover {
    background: rgba(239, 68, 68, 0.12) !important;
    background: color-mix(in srgb, var(--tuh-nc-danger) 12%, var(--tuh-nc-bg)) !important;
    background-color: color-mix(in srgb, var(--tuh-nc-danger) 12%, var(--tuh-nc-bg)) !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
    border-color: color-mix(in srgb, var(--tuh-nc-danger) 35%, var(--tuh-nc-border)) !important;
    color: var(--tuh-nc-danger) !important;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.tuh-notifications-center .tuh-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    background: var(--tuh-nc-bg) !important;
    border: 1px solid var(--tuh-nc-border) !important;
    border-radius: var(--tuh-nc-radius);
}

.tuh-notifications-center .tuh-empty-state svg {
    color: var(--tuh-nc-text-muted) !important;
    margin-bottom: 16px;
    opacity: 0.6;
}

.tuh-notifications-center .tuh-empty-state h3 {
    margin: 0 0 8px 0;
    color: var(--tuh-nc-text) !important;
    font-size: 1rem;
    font-weight: 600;
}

.tuh-notifications-center .tuh-empty-state p {
    margin: 0;
    color: var(--tuh-nc-text-muted) !important;
    font-size: 0.85rem;
}

/* ============================================
   PAGINATION
   ============================================ */

.tuh-notifications-center .tuh-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.tuh-notifications-center .tuh-pagination-info {
    font-size: 0.875rem;
    color: var(--tuh-nc-text-muted) !important;
}

/* ============================================
   ANIMATIONS
   ============================================ */

.tuh-notifications-center .tuh-notification-item.removing {
    animation: tuhItemFadeOut 0.3s ease forwards;
}

@keyframes tuhItemFadeOut {
    to {
        opacity: 0;
        transform: translateX(20px);
        height: 0;
        padding: 0;
        margin: 0;
        border-width: 0;
    }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
    .tuh-notifications-center .tuh-notifications-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .tuh-notifications-center .tuh-notifications-actions {
        width: 100%;
    }

    .tuh-notifications-center .tuh-notifications-actions .tuh-btn,
    .tuh-section .tuh-notifications-center .tuh-notifications-actions .tuh-btn {
        flex: 1;
        justify-content: center;
    }

    .tuh-notifications-center .tuh-notifications-filters {
        padding: 10px;
    }

    .tuh-notifications-center .tuh-filter-form {
        flex-direction: column;
        gap: 10px;
    }

    .tuh-notifications-center .tuh-filter-group {
        width: 100%;
    }

    .tuh-notifications-center .tuh-filter-group label {
        font-size: 0.72rem;
    }

    .tuh-notifications-center .tuh-filter-group select {
        width: 100%;
        min-height: 40px;
        font-size: 0.9rem;
    }

    .tuh-notifications-center .tuh-notification-item {
        display: grid !important;
        grid-template-columns: 38px minmax(0, 1fr) !important;
        column-gap: 12px;
        row-gap: 8px;
        align-items: start;
        padding: 14px;
        width: 100%;
    }

    .tuh-notifications-center .tuh-notification-icon {
        grid-column: 1;
        grid-row: 1;
        width: 38px;
        height: 38px;
    }

    .tuh-notifications-center .tuh-notification-content {
        grid-column: 2;
        grid-row: 1;
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .tuh-notifications-center .tuh-notification-icon svg {
        width: 18px;
        height: 18px;
    }

    .tuh-notifications-center .tuh-notification-header {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px;
        align-items: flex-start;
        width: 100%;
    }

    .tuh-notifications-center .tuh-notification-time {
        order: -1;
        font-size: 0.76rem;
    }

    .tuh-notifications-center .tuh-notification-title {
        font-size: 0.95rem;
        word-break: normal !important;
        overflow-wrap: break-word !important;
    }

    .tuh-notifications-center .tuh-notification-message {
        font-size: 0.9rem;
        line-height: 1.45;
        word-break: normal !important;
        overflow-wrap: break-word !important;
    }

    .tuh-notifications-center .tuh-notification-actions {
        grid-column: 1 / -1;
        grid-row: 2;
        margin-top: 0;
        padding-top: 10px;
        border-top: 1px solid var(--tuh-nc-border);
        width: 100%;
        justify-content: flex-end;
        display: flex !important;
    }

    .tuh-notifications-center .tuh-btn-icon,
    .tuh-section .tuh-notifications-center .tuh-btn-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .tuh-notifications-center .tuh-pagination {
        flex-direction: column;
        gap: 12px;
    }
}

/* ============================================
   ACTION BUTTONS - Always visible
   ============================================ */

.tuh-notifications-center .tuh-notification-actions {
    opacity: 1;
    display: flex;
    gap: 4px;
}
