/* Animazione rotazione */
@keyframes findp-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.findp-container {
    width: 100%;
    overflow-x: hidden;
    /* Taglia eventuali fuoriuscite accidentali */
    display: block;
    /* Forza il comportamento standard se il CSS globale lo cambia */
}

.findp-search-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1rem;
    text-align: center;
}

.findp-input-group {
    position: relative;
    margin-bottom: 2rem;
}

.findp-input {
    width: 100%;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    color: white;
    font-family: inherit;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    outline: none;
}

.findp-input:focus {
    box-shadow: 0 0 15px rgba(207, 174, 112, 0.4);
    background: rgba(0, 0, 0, 0.8);
}

.findp-results-list {
    display: grid;
    /* auto-fit è meglio di auto-fill per evitare spazi vuoti a destra */
    /* minmax(280px, 1fr) assicura che le card non diventino troppo strette */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    /* Il padding laterale evita che le card tocchino i bordi dello schermo su mobile */
    padding: 0 15px 50px 15px;
    /* Impedisce la fuoriuscita orizzontale */
    overflow-x: hidden;
}

.findp-player-card {
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    text-decoration: none;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    animation: fadeIn 0.4s ease forwards;
    /* Molto importante: la card non deve mai superare la larghezza della colonna */
    width: 100%;
    max-width: 100%;
    min-width: 0;
    /* Fondamentale per il comportamento della grid */
    overflow: hidden;
    /* Taglia eventuali testi che debordano */
}

.findp-player-card:hover {
    background: rgba(207, 174, 112, 0.1);
    transform: translateY(-3px);
    border-color: var(--primary-color);
}

.findp-player-info {
    text-align: left;
    flex: 1;
}

.findp-player-name {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.findp-player-details {
    font-size: 0.9rem;
    opacity: 0.8;
    display: flex;
    gap: 15px;
}

.findp-badge {
    background: var(--primary-color);
    color: black;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* Fix per i testi lunghi che potrebbero spingere la card fuori */
.findp-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.findp-no-results {
    opacity: 0.6;
    margin-top: 2rem;
    text-align: center;
}

.findp-load-more-container {
    text-align: center;
    margin: 20px 0 50px 0;
    display: none;
    /* Nascosto di default */
}

.findp-btn-more {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 30px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    transition: all 0.3s ease;
}

.findp-btn-more:hover {
    background: var(--primary-color);
    color: black;
    box-shadow: 0 0 15px var(--primary-color);
}

/* Stile per il contatore */
.findp-counter {
    text-align: center;
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.findp-load-more-container {
    grid-column: 1 / -1;
    /* Occupa tutta la riga nella grid */
    text-align: center;
    margin: 20px 0 50px 0;
}

.findp-loader {
    text-align: center;
    padding: 2rem;
    color: var(--primary-color);
    font-weight: bold;
}

/* Container per il loader */
.findp-loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 15px;
}

/* La rotellina (spinner) */
.findp-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: findp-spin 1s linear infinite;
}

/* Overlay a tutta pagina mostrato alla scelta del giocatore */
.findp-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(2px);
}

.findp-overlay.active {
    display: flex;
}

.findp-loader-text {
    color: var(--primary-color);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.8rem;
}