/* ===== Notifications System Styles ===== */

/* Notifications Bell Icon in Header */
.notifications-bell {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.notifications-bell:hover {
    background-color: var(--bg-tertiary);
}

.notifications-bell i {
    font-size: 20px;
    color: var(--text-primary);
}

.notifications-bell .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--error);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Notifications Overlay (backdrop) */
.notifications-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
    animation: fadeIn 0.3s ease;
}

.notifications-overlay.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Notifications Dropdown */
.notifications-dropdown {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 380px;
    max-height: calc(100vh - 80px);
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    z-index: 9999;
    animation: slideDown 0.3s ease;
}

.notifications-dropdown.active {
    display: flex;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notifications-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.mark-all-read {
    color: var(--accent-primary);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mark-all-read:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.notifications-list {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.notifications-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.notifications-empty i {
    font-size: 48px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

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

/* Individual Notification Item */
.notification-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

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

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

.notification-item.unread {
    background-color: rgba(14, 165, 233, 0.05);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-primary);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

/* Icon Colors by Type */
.notification-blue {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
}

.notification-purple {
    background: rgba(147, 51, 234, 0.1);
    color: #9333ea;
}

.notification-green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.notification-red {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.notification-orange {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.notification-yellow {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
}

.notification-pink {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.notification-default {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

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

.notification-text {
    font-size: 14px;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.notification-time {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Toast Notification (for real-time alerts) */
.notification-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    max-width: 380px;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    z-index: 10000;
    animation: toastSlideIn 0.3s ease;
    cursor: pointer;
}

.notification-toast.hiding {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(400px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

.notification-toast .notification-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
}

.notification-toast .notification-text {
    font-size: 13px;
    flex: 1;
    margin: 0;
}

.notification-toast-close {
    color: var(--text-tertiary);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
}

.notification-toast-close:hover {
    color: var(--text-primary);
}

/* Settings Section for Notifications */
.notification-settings {
    padding: 20px;
}

.notification-settings h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.notification-setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.notification-setting-label {
    flex: 1;
}

.notification-setting-label h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.notification-setting-label p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .notifications-dropdown {
        right: 10px;
        left: 10px;
        width: auto;
        top: 70px;
        max-height: calc(100vh - 90px);
    }

    .notification-toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .notifications-dropdown {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
        animation: slideUp 0.3s ease;
    }
    
    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .notification-item {
        padding: 12px 16px;
    }

    .notification-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .notification-text {
        font-size: 13px;
    }

    .notification-time {
        font-size: 11px;
    }
}

/* Dark Theme Adjustments */
[data-theme="dark"] .notification-toast {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .notification-item.unread {
    background-color: rgba(34, 211, 238, 0.08);
}
