/* Notification Bell Component */

.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-bell:hover {
    background: var(--bg-hover, #f0f0f0);
}

.bell-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 0;
    background: #dc3545;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* Dropdown */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 480px;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notification-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    font-weight: 600;
    font-size: 0.95rem;
}

.notification-dropdown-header button {
    background: none;
    border: none;
    color: var(--accent-color, #667eea);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.notification-dropdown-header button:hover {
    background: var(--bg-hover, #f0f0f0);
}

.notification-dropdown-list {
    overflow-y: auto;
    max-height: 400px;
    flex: 1;
}

.notification-dropdown-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-secondary, #888);
    font-size: 0.9rem;
}

/* Notification Item */
.notification-item {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color, #f0f0f0);
    cursor: pointer;
    transition: background 0.15s;
    border-left: 3px solid transparent;
}

.notification-item:hover {
    background: var(--bg-hover, #f8f9fa);
}

.notification-item.unread {
    background: var(--bg-secondary, #f8f9fa);
}

/* Type-based left border colors */
.notification-item[data-type="post_published"] {
    border-left-color: #28a745;
}

.notification-item[data-type="post_failed"] {
    border-left-color: #dc3545;
}

.notification-item[data-type="token_expiring"],
.notification-item[data-type="quota_warning"] {
    border-left-color: #ffc107;
}

.notification-item[data-type="token_expired"],
.notification-item[data-type="quota_reached"] {
    border-left-color: #dc3545;
}

.notification-item[data-type="system"] {
    border-left-color: #667eea;
}

.notification-item-content {
    flex: 1;
    min-width: 0;
}

.notification-item-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary, #333);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-item-message {
    font-size: 0.78rem;
    color: var(--text-secondary, #888);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-item-time {
    font-size: 0.7rem;
    color: var(--text-tertiary, #aaa);
    white-space: nowrap;
    margin-top: 4px;
}

/* Responsive */
@media (max-width: 480px) {
    .notification-dropdown {
        width: calc(100vw - 24px);
        right: -60px;
    }
}

/* Dark mode */
[data-theme="dark"] .notification-dropdown {
    background: var(--bg-primary, #1a1a2e);
    border-color: var(--border-color, #333);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .notification-item.unread {
    background: var(--bg-secondary, #16213e);
}

[data-theme="dark"] .notification-item:hover {
    background: var(--bg-hover, #1e2a4a);
}
