/* =============================================
   Shared Notifications Page
   ============================================= */

.notifications-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-color, #f5f5f5);
    padding: 24px;
    padding-top: 120px;
}

.notifications-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-secondary, white);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-tertiary, #f9fafb);
}

.notifications-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notifications-title i {
    font-size: 28px;
    color: var(--primary-color, #00b4ff);
}

.notifications-title h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
}

.notifications-badge {
    background: #ef4444;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.notifications-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    color: var(--text-secondary, #6b7280);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover:not(:disabled) {
    background: var(--bg-hover, #f3f4f6);
    border-color: var(--primary-color, #00b4ff);
    color: var(--primary-color, #00b4ff);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn .spinning {
    animation: notif-spin 1s linear infinite;
}

/* ?? Filter Bar ?? */

.notifications-filter-bar {
    display: flex;
    gap: 4px;
    padding: 16px 24px;
    background: var(--bg-tertiary, #f9fafb);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.filter-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary, #6b7280);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tab:hover {
    background: var(--bg-hover, #e5e7eb);
}

.filter-tab.active {
    background: var(--primary-color, #00b4ff);
    color: white;
}

.filter-badge {
    background: white;
    color: var(--primary-color, #00b4ff);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
}

.filter-tab.active .filter-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ?? Content States ?? */

.notifications-content {
    min-height: 400px;
}

.notifications-loading,
.notifications-empty,
.notifications-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
}

.notifications-loading i,
.notifications-empty i,
.notifications-error i {
    font-size: 64px;
    color: var(--text-secondary, #9ca3af);
    margin-bottom: 24px;
}

.notifications-empty h3,
.notifications-error h3 {
    margin: 0 0 8px;
    font-size: 1.25rem;
    color: var(--text-primary, #111827);
}

.notifications-empty p,
.notifications-error p {
    margin: 0;
    color: var(--text-secondary, #6b7280);
    max-width: 400px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color, #e5e7eb);
    border-top-color: var(--primary-color, #00b4ff);
    border-radius: 50%;
    animation: notif-spin 0.8s linear infinite;
    margin-bottom: 24px;
}

.loading-spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color, #e5e7eb);
    border-top-color: var(--primary-color, #00b4ff);
    border-radius: 50%;
    animation: notif-spin 0.8s linear infinite;
}

@keyframes notif-spin {
    to { transform: rotate(360deg); }
}

.retry-btn {
    margin-top: 20px;
    padding: 12px 24px;
    background: var(--primary-color, #00b4ff);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    background: var(--secondary-color, #0174b1);
    transform: translateY(-1px);
}

/* ?? Notification Cards ?? */

.notifications-list {
    padding: 16px;
}

.notification-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-secondary, white);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border: 1px solid transparent;
}

.notification-card:hover {
    background: var(--bg-hover, #f9fafb);
    border-color: var(--border-color, #e5e7eb);
    transform: translateX(4px);
}

.notification-card.unread {
    background: rgba(0, 180, 255, 0.04);
    border-left: 3px solid var(--primary-color, #00b4ff);
}

.notification-card.processing {
    opacity: 0.6;
    pointer-events: none;
}

.notification-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon-wrapper i {
    font-size: 20px;
    color: white;
}

.notification-body {
    flex: 1;
    min-width: 0;
}

.notification-message {
    margin: 0 0 6px;
    font-size: 0.95rem;
    color: var(--text-primary, #111827);
    line-height: 1.5;
}

.notification-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--text-secondary, #6b7280);
}

.notification-unread-indicator {
    width: 10px;
    height: 10px;
    background: var(--primary-color, #00b4ff);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 8px;
}

.notification-delete {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #9ca3af);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
}

.notification-card:hover .notification-delete {
    opacity: 1;
}

.notification-delete:hover {
    background: #ef4444;
    color: white;
}

/* ?? Load More ?? */

.load-more-section {
    padding: 24px;
    text-align: center;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.load-more-btn {
    padding: 12px 32px;
    background: transparent;
    border: 2px solid var(--primary-color, #00b4ff);
    border-radius: 8px;
    color: var(--primary-color, #00b4ff);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-more-btn:hover:not(:disabled) {
    background: var(--primary-color, #00b4ff);
    color: white;
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ?? Responsive ?? */

@media (max-width: 768px) {
    .notifications-page {
        padding: 12px;
        padding-top: 80px;
    }

    .notifications-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .notifications-actions {
        width: 100%;
    }

    .action-btn {
        flex: 1;
        justify-content: center;
    }

    .action-btn span {
        display: none;
    }

    .notification-card {
        padding: 12px 16px;
    }

    .notification-icon-wrapper {
        width: 40px;
        height: 40px;
    }

    .notification-delete {
        opacity: 1;
    }
}

/* ?? Dark Mode ?? */

body.dark-mode .notifications-page {
    background: var(--bg-color, #121212);
}

body.dark-mode .notifications-container {
    background: var(--bg-secondary, #1e1e1e);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .notifications-header,
body.dark-mode .notifications-filter-bar {
    background: var(--bg-tertiary, #252525);
    border-color: var(--border-color, #333);
}

body.dark-mode .notifications-title h1 {
    color: var(--text-primary, #f0f0f0);
}

body.dark-mode .notifications-empty h3,
body.dark-mode .notifications-error h3 {
    color: var(--text-primary, #f0f0f0);
}

body.dark-mode .notifications-empty p,
body.dark-mode .notifications-error p,
body.dark-mode .notifications-loading p {
    color: var(--text-secondary, #aaa);
}

body.dark-mode .notification-card {
    background: var(--bg-secondary, #1e1e1e);
    border-color: var(--border-color, #333);
}

body.dark-mode .notification-card:hover {
    background: var(--bg-tertiary, #2a2a2a);
    border-color: var(--border-color, #444);
}

body.dark-mode .notification-card.unread {
    background: rgba(0, 180, 255, 0.1);
}

body.dark-mode .notification-message {
    color: var(--text-primary, #f0f0f0);
}

body.dark-mode .notification-time {
    color: var(--text-secondary, #aaa);
}

body.dark-mode .action-btn {
    color: var(--text-secondary, #aaa);
    border-color: var(--border-color, #444);
}

body.dark-mode .action-btn:hover:not(:disabled) {
    background: var(--bg-tertiary, #333);
    color: var(--primary-color, #00b4ff);
}

body.dark-mode .filter-tab {
    color: var(--text-secondary, #aaa);
}

body.dark-mode .filter-tab:hover {
    background: var(--bg-tertiary, #333);
}

body.dark-mode .filter-tab.active {
    background: var(--primary-color, #00b4ff);
    color: white;
}

body.dark-mode .load-more-section {
    border-color: var(--border-color, #333);
}

body.dark-mode .loading-spinner {
    border-color: var(--border-color, #444);
    border-top-color: var(--primary-color, #00b4ff);
}
