/* Notifications CSS - Inspired by GitHub, Notion, ElevenLabs */

.notification-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-trigger {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    position: relative;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-trigger:hover {
    color: var(--text-main);
    background-color: var(--bg-hover);
}

.notification-trigger.active {
    color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.1);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 0 2px var(--surface);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.notification-badge.hidden {
    transform: scale(0);
    opacity: 0;
}

/* Panel */
.notification-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: -10px;
    width: 380px;
    background-color: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
}

[data-theme="dark"] .notification-panel {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255,255,255,0.1);
}

.notification-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header */
.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--surface);
    z-index: 2;
}

.notification-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
}

.notification-actions {
    display: flex;
    gap: 0.5rem;
}

.notification-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 999px;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-action-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-main);
}

/* Filter Dropdown */
.filter-dropdown-container {
    position: relative;
}

.filter-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
    min-width: 150px;
    z-index: 9999999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

[data-theme="dark"] .filter-menu {
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.filter-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-option {
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-option:hover {
    background-color: var(--bg-hover);
}

.filter-option.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    font-weight: 500;
}

/* List */
.notification-list {
    overflow-y: auto;
    flex: 1;
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Custom Scrollbar for list */
.notification-list::-webkit-scrollbar {
    width: 6px;
}
.notification-list::-webkit-scrollbar-track {
    background: transparent;
}
.notification-list::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.3);
    border-radius: 10px;
}

.notification-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
}
.notification-empty i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    display: block;
}

.notification-item {
    display: flex;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
    position: relative;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

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

.notification-item:hover {
    background-color: var(--bg-hover);
}

.notification-item.unread {
    background-color: rgba(59, 130, 246, 0.03);
}
[data-theme="dark"] .notification-item.unread {
    background-color: rgba(59, 130, 246, 0.05);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--primary-color);
}

.notification-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-left: 4px;
}

/* Category Colors */
.notif-generation { background-color: rgba(16, 185, 129, 0.1); color: #10b981; }
.notif-cloning { background-color: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.notif-premium { background-color: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.notif-new_voices { background-color: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.notif-news { background-color: rgba(236, 72, 153, 0.1); color: #ec4899; }
.notif-warnings { background-color: rgba(249, 115, 22, 0.1); color: #f97316; }
.notif-subscription { background-color: rgba(20, 184, 166, 0.1); color: #14b8a6; }
.notif-errors { background-color: rgba(239, 68, 68, 0.1); color: #ef4444; }

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.notification-desc {
    margin: 0 0 0.4rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.notification-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notification-time {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.notification-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    padding: 2px;
    position: relative;
    z-index: 10;
}

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

.notification-item .notification-delete-btn:hover {
    opacity: 1;
    color: #ef4444;
}

/* Responsive */
@media (max-width: 768px) {
    .notification-panel {
        position: fixed !important;
        top: 64px !important;
        right: 12px !important;
        left: auto !important;
        width: calc(100vw - 24px) !important;
        max-width: 360px !important;
        max-height: calc(100vh - 80px) !important;
        overflow-y: auto !important;
    }
    .notification-item-content {
        overflow-wrap: anywhere !important;
    }
}
