.cyber-ranking-wrapper {
    position: relative;
    background: #0a0a0a;
    border: 1px solid #222;
    padding: 25px;
    border-radius: 4px;
    font-family: 'Share Tech Mono', monospace;
    margin: 30px 0;
}

.ranking-header h3 { color: #fff; margin: 0 0 5px 0; font-size: 18px; letter-spacing: 1px; }
.ranking-header p { color: #666; font-size: 12px; margin-bottom: 30px; }

/* Item interactif */
.ranking-item { margin-bottom: 20px; cursor: pointer; padding: 10px; border-radius: 4px; transition: background 0.3s, transform 0.2s; border: 1px solid transparent; }
.ranking-item:hover { background: rgba(255,255,255,0.03); border-color: #333; transform: translateX(5px); }

.item-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rank-number { color: #D4FF00; font-weight: bold; font-size: 14px; margin-right: 15px; }
.target-name { color: #fff; font-size: 16px; flex: 1; text-transform: uppercase; }
.target-count { color: #888; font-size: 11px; }

.progress-container { background: #1a1a1a; height: 24px; border-radius: 2px; overflow: hidden; border: 1px solid #333; }
.progress-bar { background: linear-gradient(90deg, #D4FF00 0%, #ff8800 100%); height: 100%; width: 0; transition: width 1.5s cubic-bezier(0.1, 0.5, 0.1, 1); display: flex; align-items: center; padding-left: 10px; position: relative; }
.threat-label { color: #000; font-size: 9px; font-weight: bold; white-space: nowrap; }

.ranking-item:first-child .progress-bar { background: linear-gradient(90deg, #ff003c 0%, #ff8800 100%); }
.ranking-footer { margin-top: 20px; text-align: right; font-size: 9px; color: #444; text-transform: uppercase; }

/* --- STYLE DE LA MODALE --- */
.ranking-modal {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s;
}
.ranking-modal.hidden { opacity: 0; pointer-events: none; }

.modal-content {
    background: #0d0d0d;
    border: 1px solid #ff8800;
    width: 90%; max-height: 90%;
    border-radius: 6px;
    box-shadow: 0 0 30px rgba(255, 136, 0, 0.3);
    display: flex; flex-direction: column;
}

.modal-header {
    background: #ff8800; color: #000;
    padding: 10px 15px; font-weight: bold; font-size: 12px;
    display: flex; justify-content: space-between; align-items: center;
}
.close-modal { cursor: pointer; font-size: 16px; transition: 0.2s; }
.close-modal:hover { color: #fff; transform: scale(1.2); }

.modal-body { padding: 15px; overflow-y: auto; }
#modal-alerts-list { list-style: none; padding: 0; margin: 0; }

.alert-li {
    background: #111; border-left: 3px solid #444;
    padding: 10px; margin-bottom: 10px; border-radius: 0 4px 4px 0;
    transition: background 0.2s;
}
.alert-li:hover { background: #1a1a1a; }

.alert-li.Critical { border-left-color: #ff003c; }
.alert-li.High { border-left-color: #ff8800; }

.alert-top { display: flex; justify-content: space-between; font-size: 10px; color: #666; margin-bottom: 5px; }
.alert-title { font-size: 12px; color: #eee; margin-bottom: 8px; line-height: 1.4; }

.alert-link {
    display: inline-block; background: rgba(212, 255, 0, 0.1);
    color: #D4FF00; text-decoration: none; font-size: 10px;
    padding: 4px 8px; border: 1px solid #D4FF00; border-radius: 3px;
    transition: 0.3s;
}
.alert-link:hover { background: #D4FF00; color: #000; }

/* ================================================== */
/*             RESPONSIVE TARGET RANKING              */
/* ================================================== */

@media (max-width: 768px) {
    .cyber-ranking-wrapper {
        padding: 20px 15px;
        margin: 20px 0;
    }

    .ranking-header h3 {
        font-size: 16px;
    }

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

    .modal-content {
        width: 95%;
        max-height: 85%;
    }
}

@media (max-width: 480px) {
    .ranking-header p {
        font-size: 10px;
        margin-bottom: 20px;
    }

    /* On réorganise les infos de la ligne pour gagner de la place */
    .item-info {
        flex-wrap: wrap;
        gap: 5px;
    }

    .rank-number {
        font-size: 12px;
        margin-right: 8px;
    }

    .target-name {
        font-size: 13px;
        flex: 1;
    }

    .target-count {
        font-size: 9px;
        width: 100%; /* Passe le nombre d'alertes à la ligne */
        margin-left: 32px; /* Aligne avec le nom */
        color: #666;
    }

    .progress-container {
        height: 20px;
    }

    .threat-label {
        font-size: 8px;
    }

    .ranking-footer {
        font-size: 8px;
    }

    /* --- MODALE MOBILE --- */
    .ranking-modal {
        position: fixed; /* Fixe sur mobile pour éviter les problèmes de scroll */
        z-index: 10000;
    }

    .modal-header {
        padding: 12px;
    }

    .modal-title {
        font-size: 10px;
    }

    .alert-li {
        padding: 12px 8px;
    }

    .alert-title {
        font-size: 11px;
    }

    .alert-link {
        width: 100%; /* Bouton pleine largeur pour le pouce */
        text-align: center;
        padding: 8px;
    }
}