// Dropdown Menu
.easydocs-dropdown {
    @include absolute(top 130% right -20px);
    @include shadow(0 30px 40px 0 rgba(4, 73, 89, 0.1));
    background-color: var(--clr-white);
    border-radius: 0.5rem;
    z-index: 999;
    @include property;
    display: none;

    &.is-active {
        opacity: 1;
        visibility: visible;
        top: 130%;
    }
}

// ============================================
// Modern Notification Dropdown - Redesigned
// ============================================
.notification-dropdown {
    width: 400px;
    max-width: 95vw;
    border-radius: 12px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.12),
        0 8px 25px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: notificationSlideIn 0.25s ease-out;

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

    &::before {
        content: "";
        position: absolute;
        top: -8px;
        right: 24px;
        width: 16px;
        height: 16px;
        background: var(--frmx_brand_color);
        transform: rotate(45deg);
        border-radius: 2px;
        box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.05);
    }
}

// Notification Header
.notification-head {
    padding: 16px 20px;
    background: var(--frmx_brand_color);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;

    &::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
        pointer-events: none;
    }

    &.no-notification-text {
        padding: 40px 20px;
        background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        color: #6b7280;
        font-size: 14px;
        font-weight: 500;

        &::before {
            content: "🔔";
            font-size: 32px;
            margin-bottom: 10px;
            opacity: 0.6;
        }
    }

    .header-text {
        color: #fff;
        font-size: 16px;
        font-weight: 700;
        letter-spacing: 0.3px;
        position: relative;
        z-index: 1;
        text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    }

    .notification-action-btn {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 20px; 
        padding: 6px 14px;
        font-size: 12px;
        font-weight: 500;
        color: #fff;
        cursor: pointer;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        backdrop-filter: blur(4px);
        display: flex;
        align-items: center;
        gap: 6px;
        position: relative;
        z-index: 1;

        &:hover {
            background: rgba(255, 255, 255, 0.25);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }
        
        &:active {
            transform: translateY(0);
        }

        .dashicons {
            font-size: 14px;
            width: 14px;
            height: 14px;
        }
    }
}

// Notification Filter Tabs
.notification-tabs {
    display: flex;
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    gap: 16px;

    .notification-tab {
        padding: 14px 4px;
        background: transparent;
        border: none;
        border-bottom: 2px solid transparent;
        font-size: 13px;
        font-weight: 500;
        color: #64748b;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        gap: 6px;
        position: relative;

        &:hover {
            color: #334155;
            
            .tab-count {
                background: #e2e8f0;
            }
        }

        &.is-active {
            color: var(--frmx_brand_color);
            border-bottom-color: var(--frmx_brand_color);
            
            .tab-count {
                background: var(--frmx_brand_color);
                color: #fff;
            }
        }

        .tab-count {
            background: #f1f5f9;
            color: #64748b;
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 600;
            min-width: 20px;
            text-align: center;
            transition: all 0.2s ease;
        }
    }
}

// Notification Body
.notification-body {
    background: #fff;
    position: relative;
}

.notify-column {
    max-height: 400px;
    overflow-y: auto;
    // Elegant Scrollbar
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;

    &::-webkit-scrollbar {
        width: 5px;
    }
    
    &::-webkit-scrollbar-track {
        background: transparent;
    }

    &::-webkit-scrollbar-thumb {
        background-color: #cbd5e1;
        border-radius: 20px;
        border: 2px solid transparent; // Creates padding feeling
        background-clip: content-box;

        &:hover {
            background-color: #94a3b8;
        }
    }

    ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    // Individual Notification Item
    .notify-item {
        border-bottom: 1px solid #f1f5f9;
        margin: 0;
        position: relative;
        transition: background 0.2s ease;

        &:last-child {
            border-bottom: none;
        }

        &:hover {
            background: #f8fafc;
            
            .notify-content-summary p {
                color: #1e293b;
            }
        }

        &.is-unread {
            background: #fdfeff; 

            &::before {
                content: "";
                position: absolute;
                left: 0;
                top: 0;
                bottom: 0;
                width: 3px;
                background: var(--frmx_brand_color);
                box-shadow: 2px 0 8px rgba(102, 126, 234, 0.4);
            }
        }

        > a {
            display: flex;
            padding: 16px 20px;
            gap: 16px;
            text-decoration: none;
            align-items: flex-start;
        }
    }

    // Notification Icon
    .notify-icon {
        flex-shrink: 0;
    }

    .notify-icon-wrapper {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f1f5f9; // Default fallback
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
        box-shadow: 0 2px 6px rgba(0,0,0,0.04);

        // Reply type
        &.type-reply {
            background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
            box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
        }

        // Closed topic type
        &.type-closed {
            background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
            box-shadow: 0 4px 10px rgba(245, 158, 11, 0.2);
        }

        // Solved topic type
        &.type-solved {
            background: var(--frmx_brand_color);
             box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
        }

        .dashicons, 
        .icon_check_alt {
            color: #fff;
            filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
        }

        .dashicons {
            font-size: 20px;
            width: 20px;
            height: 20px;
        }
        
        .icon_check_alt {
             font-size: 18px;
        }
    }

    // Content area
    .notify-content-wrap {
        flex: 1;
        min-width: 0;
    }

    .notify-content-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 6px;
        gap: 8px;
    }

    .noti-type {
        font-size: 11px;
        font-weight: 700;
        color: #475569;
        background: #e2e8f0;
        padding: 2px 8px;
        border-radius: 6px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        display: inline-block;

        &.resolved {
            background: #e0e7ff;
            color: var(--frmx_brand_color);
        }
    }

    .notify-creation {
        font-size: 11px;
        color: #94a3b8;
        white-space: nowrap;
    }

    .notify-content-summary {
        p {
            font-size: 13px;
            line-height: 1.5;
            color: #64748b;
            margin: 0;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            font-weight: 400;
        }
    }
}

// Loading State for Infinite Scroll
.notification-loading {
    padding: 16px;
    text-align: center;
    background: #f9fafb;
    border-top: 1px solid #f3f4f6;

    .loading-spinner {
        display: inline-block;
        width: 20px;
        height: 20px;
        border: 2px solid #e5e7eb;
        border-top-color: var(--frmx_brand_color);
        border-radius: 50%;
        animation: notificationSpin 0.8s linear infinite;
    }

    @keyframes notificationSpin {
        to {
            transform: rotate(360deg);
        }
    }

    .loading-text {
        font-size: 12px;
        color: #9ca3af;
        margin-top: 6px;
    }
}

// No More Notifications
.notification-end {
    padding: 14px;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    background: #f9fafb;
    border-top: 1px solid #f3f4f6;

    &::before {
        content: "✓";
        display: inline-block;
        margin-right: 6px;
        color: #10b981;
    }
}

// Notification Footer
.notification-footer {
    padding: 12px 16px;
    background: #f8f9fb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;

    .view-all-link {
        font-size: 13px;
        font-weight: 500;
        color: var(--frmx_brand_color);
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 6px;
        transition: all 0.2s ease;

        &:hover {
            color: #764ba2;
            gap: 10px;
        }

        .dashicons {
            font-size: 14px;
            width: 14px;
            height: 14px;
            transition: transform 0.2s ease;
        }

        &:hover .dashicons {
            transform: translateX(3px);
        }
    }
}

// Empty State
.notification-empty {
    padding: 40px 20px;
    text-align: center;

    .empty-icon {
        width: 64px;
        height: 64px;
        margin: 0 auto 16px;
        background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;

        .dashicons {
            font-size: 28px;
            width: 28px;
            height: 28px;
            color: #9ca3af;
        }
    }

    .empty-title {
        font-size: 15px;
        font-weight: 600;
        color: #374151;
        margin-bottom: 6px;
    }

    .empty-text {
        font-size: 13px;
        color: #9ca3af;
        line-height: 1.5;
    }
}

// Notification Skeleton Loading
.notification-skeleton {
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    animation: skeletonPulse 1.5s ease-in-out infinite;

    @keyframes skeletonPulse {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.5; }
    }

    .skeleton-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: #e5e7eb;
    }

    .skeleton-content {
        flex: 1;

        .skeleton-line {
            height: 12px;
            background: #e5e7eb;
            border-radius: 4px;
            margin-bottom: 8px;

            &:first-child {
                width: 40%;
            }
            &:last-child {
                width: 80%;
                margin-bottom: 0;
            }
        }
    }
}