/* Notifications Overlay */
.notifications-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notifications-overlay.show {
    display: flex;
    opacity: 1;
}

/* Desktop Modal Style */
.notifications-container {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 600px;
    margin: auto;
    display: flex;
    flex-direction: column;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.notifications-overlay.show .notifications-container {
    transform: translateY(0);
}

/* Desktop Header */
.desktop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
}

.desktop-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.mobile-header {
    display: none;
}

.notifications-close {
    background: none;
    border: none;
    color: #6B7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.notifications-close:hover {
    background: #F3F4F6;
}

/* Notifications Content */
.notifications-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notifications-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    min-height: 200px;
}

.notifications-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    margin: 0;
}

.notification-item {
    padding: 16px 24px;
    border-bottom: 1px solid #F3F4F6;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.notification-item:hover {
    background: #F9FAFB;
}

.notification-item:last-child {
    border-bottom: none;
}

/* Unread notification styling */
.notification-item.unread {
    background: #F0F8FF;
    border-left: 4px solid #007ACF;
}

.notification-item.unread::after {
    content: '';
    position: absolute;
    top: 20px;
    right: 20px;
    width: 8px;
    height: 8px;
    background: #007ACF;
    border-radius: 50%;
}

.notification-item.unread:hover {
    background: #E6F3FF;
}

.notification-content {
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.notification-content.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-content.expanded {
    display: block;
}

.notification-date {
    color: #9CA3AF;
    font-size: 12px;
    font-weight: 500;
}

.notification-expand-btn {
    color: #007ACF;
    font-size: 12px;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-top: 4px;
    display: none;
}

.notification-item.has-more .notification-expand-btn {
    display: inline-block;
}

.notifications-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    color: #9CA3AF;
}

.notifications-empty svg {
    margin-bottom: 16px;
    opacity: 0.6;
}

.notifications-empty p {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

/* Loading more indicator */
.loading-more {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    border-top: 1px solid #F3F4F6;
    background: #FAFBFC;
}

.loading-spinner {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6B7280;
    font-size: 14px;
}

.loading-spinner .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #E5E7EB;
    border-top: 2px solid #007ACF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .notifications-overlay {
        background: transparent;
        align-items: flex-end;
        justify-content: stretch;
    }

    .notifications-container {
        width: 100%;
        max-width: none;
        margin: 0;
        max-height: 80vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .notifications-overlay.show .notifications-container {
        transform: translateY(0);
    }

    .desktop-header {
        display: none;
    }

    .mobile-header {
        display: flex;
        flex-direction: column;
        padding: 12px 20px 16px;
        border-bottom: 1px solid #E5E7EB;
        position: relative;
    }

    .notifications-drag-handle {
        width: 36px;
        height: 4px;
        background: #D1D5DB;
        border-radius: 2px;
        margin: 0 auto 12px;
    }

    .mobile-header>div:not(.notifications-drag-handle) {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .mobile-header h2 {
        font-size: 18px;
        font-weight: 600;
        color: #111827;
        margin: 0;
    }

    .mobile-header .notifications-close {
        padding: 4px;
    }

    .notification-item {
        padding: 16px 20px;
    }

    .notification-item.unread::after {
        top: 20px;
        right: 20px;
    }

    .notification-content {
        font-size: 14px;
        line-height: 1.4;
    }

    .notifications-empty {
        padding: 40px 20px;
    }

    /* Backdrop for mobile */
    .notifications-overlay::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.3);
        z-index: -1;
    }
}

/* Animation Classes */
.notification-item.expanding .notification-content {
    transition: max-height 0.3s ease-out;
}

.notification-item.collapsing .notification-content {
    transition: max-height 0.3s ease-in;
}

/* Scrollbar Styling */
.notifications-list::-webkit-scrollbar {
    width: 6px;
}

.notifications-list::-webkit-scrollbar-track {
    background: #F3F4F6;
}

.notifications-list::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

.notifications-list::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}