.attack-patterns-widget {
    background: linear-gradient(135deg, rgba(25, 25, 35, 0.6) 0%, rgba(15, 15, 20, 0.8) 100%);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(229, 199, 56, 0.15);
    margin: 40px 0 0 0;
    backdrop-filter: blur(10px);
}

.attack-patterns-widget h3 {
    color: var(--wfs-yellow);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 24px 0;
    text-align: left;
    letter-spacing: 0.5px;
    text-transform: none;
}

.patterns-container {
    min-height: 200px;
}

.loading-spinner {
    text-align: center;
    color: var(--wfs-yellow);
    padding: 40px;
    font-size: 15px;
}

.patterns-list {
    animation: fadeIn 0.5s ease-in;
}

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

/* Threat Type Container */
.threat-type {
    margin-bottom: 12px;
}

/* Threat Bar - Main container for each attack pattern */
.threat-bar {
    background: rgba(229, 199, 56, 0.05);
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(229, 199, 56, 0.1);
}

.threat-bar::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--width, 0%);
    background: linear-gradient(90deg, rgba(229, 199, 56, 0.15), rgba(229, 199, 56, 0.05));
    transition: width 0.8s ease-out;
    border-radius: 10px 0 0 10px;
    z-index: 0;
}

.threat-bar:hover {
    background: rgba(229, 199, 56, 0.08);
    border-color: rgba(229, 199, 56, 0.3);
    transform: translateX(3px);
}

/* Rank indicator colors */
.threat-bar.rank-1::after { background: #ef4444; }
.threat-bar.rank-2::after { background: #f59e0b; }
.threat-bar.rank-3::after { background: #eab308; }
.threat-bar.rank-4::after { background: #10b981; }
.threat-bar.rank-5::after { background: #3b82f6; }

.threat-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 10px 0 0 10px;
}

/* Threat Rank Number */
.threat-rank {
    background: rgba(229, 199, 56, 0.2);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--wfs-yellow);
    font-size: 13px;
    flex-shrink: 0;
    z-index: 1;
    border: 1px solid rgba(229, 199, 56, 0.3);
}

/* Threat Name */
.threat-name {
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    flex-grow: 1;
    z-index: 1;
}

/* Threat Stats Container */
.threat-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    z-index: 1;
}

/* Threat Count */
.threat-count {
    color: var(--wfs-yellow);
    font-size: 16px;
    font-weight: 700;
}

/* Threat Percentage */
.threat-percentage {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 500;
    min-width: 45px;
    text-align: right;
}

.widget-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(229, 199, 56, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.last-updated {
    display: flex;
    align-items: center;
    gap: 8px;
}

#patterns-timestamp {
    color: var(--wfs-yellow);
    font-weight: 600;
}

.auto-refresh {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Pulse animation for live indicator */
@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

.live-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .attack-patterns-widget {
        padding: 24px 18px;
        margin: 30px 0 0 0;
    }

    .attack-patterns-widget h3 {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }

    .threat-bar {
        padding: 12px 14px;
        gap: 10px;
    }

    .threat-rank {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .threat-name {
        font-size: 14px;
    }

    .threat-count {
        font-size: 14px;
    }

    .threat-percentage {
        font-size: 12px;
        min-width: 40px;
    }

    .widget-footer {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}
