/**
 * TBP Pusher Notifications Styles
 */

/* Notifications Toggle Button */
.tbp-portal-notifications-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--tbp-text, #011A29);
    transition: background-color 0.2s ease;
}

.tbp-portal-notifications-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.tbp-portal-notifications-toggle .ti {
    font-size: 22px;
    line-height: 1;
}

/* Notification Badge */
.tbp-portal-notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    color: #fff;
    background: var(--tbp-accent-1, #E73755);
    border-radius: 9px;
}

.tbp-portal-notification-badge:empty,
.tbp-portal-notification-badge[data-count="0"] {
    display: none;
}

/* Notifications Dropdown */
.tbp-notifications-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.tbp-notifications-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Header */
.tbp-notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.tbp-notifications-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--tbp-text, #011A29);
}

.tbp-notifications-mark-all {
    font-size: 13px;
    color: var(--tbp-accent-2, #5CD4D6);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.2s;
}

.tbp-notifications-mark-all:hover {
    opacity: 0.8;
}

.tbp-notifications-mark-all:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Notifications List */
.tbp-notifications-list {
    max-height: 400px;
    overflow-y: auto;
}

/* Single Notification Item */
.tbp-notification-item {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.tbp-notification-item:hover {
    background: #f9f9f9;
}

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

.tbp-notification-item.is-unread {
    background: rgba(92, 212, 214, 0.08);
}

.tbp-notification-item.is-unread:hover {
    background: rgba(92, 212, 214, 0.12);
}

/* Notification Icon */
.tbp-notification-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f0f0f0;
}

.tbp-notification-icon .ti {
    font-size: 20px;
    line-height: 1;
}

/* Icon colors by type */
.tbp-notification-item[data-type="info"] .tbp-notification-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.tbp-notification-item[data-type="success"] .tbp-notification-icon {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.tbp-notification-item[data-type="warning"] .tbp-notification-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.tbp-notification-item[data-type="error"] .tbp-notification-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.tbp-notification-item[data-type="announcement"] .tbp-notification-icon {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.tbp-notification-item[data-type="task"] .tbp-notification-icon {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
}

.tbp-notification-item[data-type="message"] .tbp-notification-icon {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

/* Notification Content */
.tbp-notification-content {
    flex: 1;
    min-width: 0;
}

.tbp-notification-title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tbp-text, #011A29);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tbp-notification-message {
    margin: 0 0 6px;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tbp-notification-time {
    font-size: 12px;
    color: #999;
}

/* Empty State */
.tbp-notifications-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.tbp-notifications-empty .ti {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.tbp-notifications-empty p {
    margin: 0;
    font-size: 14px;
}

/* Loading State */
.tbp-notifications-loading {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.tbp-notifications-loading .spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid #eee;
    border-top-color: var(--tbp-accent-2, #5CD4D6);
    border-radius: 50%;
    animation: tbp-spin 0.8s linear infinite;
}

@keyframes tbp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Dropdown Footer */
.tbp-notifications-footer {
    padding: 12px 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.tbp-notifications-footer a {
    font-size: 14px;
    font-weight: 500;
    color: var(--tbp-accent-2, #5CD4D6);
    text-decoration: none;
    transition: opacity 0.2s;
}

.tbp-notifications-footer a:hover {
    opacity: 0.8;
}

/* ===================================
   All Notifications Page Styles
   =================================== */

.tbp-all-notifications {
    max-width: 100%;
    width: 100%;
}

.tbp-all-notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.tbp-all-notifications-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--tbp-text, #011A29);
}

.tbp-all-notifications-actions {
    display: flex;
    gap: 12px;
}

/* Full Notification Item (page view) */
.tbp-notification-item-full {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.tbp-notification-item-full:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.tbp-notification-item-full.is-unread {
    border-left: 3px solid var(--tbp-accent-2, #5CD4D6);
}

.tbp-notification-item-full .tbp-notification-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.tbp-notification-item-full .tbp-notification-icon .ti {
    font-size: 24px;
}

.tbp-notification-item-full .tbp-notification-title {
    font-size: 16px;
    margin-bottom: 6px;
}

.tbp-notification-item-full .tbp-notification-message {
    font-size: 14px;
    -webkit-line-clamp: unset;
    margin-bottom: 8px;
}

.tbp-notification-item-full .tbp-notification-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tbp-notification-item-full .tbp-notification-time {
    font-size: 13px;
}

.tbp-notification-item-full .tbp-notification-action {
    font-size: 13px;
    color: var(--tbp-accent-2, #5CD4D6);
}

/* Pagination */
.tbp-notifications-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.tbp-notifications-pagination a,
.tbp-notifications-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--tbp-text, #011A29);
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tbp-notifications-pagination a:hover {
    background: #f5f5f5;
    border-color: #ddd;
}

.tbp-notifications-pagination .current {
    background: var(--tbp-primary, #0B1521);
    border-color: var(--tbp-primary, #0B1521);
    color: #fff;
}

.tbp-notifications-pagination .dots {
    border: none;
    background: none;
}

/* Responsive */
@media (max-width: 480px) {
    .tbp-notifications-dropdown {
        width: 100%;
        right: -16px;
        border-radius: 0 0 12px 12px;
    }

    .tbp-all-notifications-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}
