/* ==========================================
   Contenedor Principal y Buscador Integrado
   ========================================== */
.gjp-search-wrapper {
    max-width: 520px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-sizing: border-box;
}

.gjp-search-wrapper *,
.gjp-search-wrapper *::before,
.gjp-search-wrapper *::after {
    box-sizing: border-box;
}

/* Fila única integrada */
.gjp-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.gjp-input-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

/* Icono de búsqueda dentro del input */
.gjp-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.gjp-search-box input {
    width: 100%;
    padding: 12px 36px 12px 40px; /* Espacio extra a la izq. para la lupa y a la der. para la X */
    font-size: 15px;
    border: 1.5px solid #dcdcdc;
    border-radius: 8px;
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gjp-search-box input:focus {
    border-color: #9f6e00;
    box-shadow: 0 0 0 3px rgba(159, 110, 0, 0.15);
    outline: none;
}

/* Botón "Buscar" */
.gjp-btn-search {
    background-color: #9f6e00;
    color: #ffffff;
    border: none;
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.gjp-btn-search:hover {
    background-color: #835b00;
}

.gjp-btn-search:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Botón "X" de limpieza */
.gjp-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: bold;
    color: #a0aec0;
    cursor: pointer;
    display: none;
    line-height: 1;
    user-select: none;
    z-index: 2;
    transition: color 0.2s ease;
}

.gjp-clear-btn:hover {
    color: #e53e3e;
}

/* ==========================================
   Resultados y Lista
   ========================================== */

/* Estados de Mensaje */
.gjp-loading, .gjp-no-results, .gjp-error {
    padding: 16px;
    background: #ffffff;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    border: 1px solid #edf2f7;
    margin-top: 12px;
}

.gjp-loading {
    color: #9f6e00;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.gjp-no-results {
    color: #718096;
}

.gjp-error {
    color: #e53e3e;
    border-color: #fed7d7;
    background-color: #fff5f5;
}

/* Lista de Resultados */
.gjp-results-list {
    margin: 15px 0 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Tarjeta de Jugador */
.gjp-player-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #edf2f7;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gjp-player-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.gjp-player-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 15px;
    font-weight: 600;
    color: #1a202c;
}

.gjp-thumb {
    width: 48px;
    height: 54px;
    object-fit: cover;
    object-position: top center;
    border-radius: 6px;
    border: 1px solid #e1e8ed;
    background-color: #f7fafc;
}

.gjp-btn-detail-icon {
    width: 36px;
    height: 36px;
    background-color: #0073aa;
    color: #ffffff;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.gjp-btn-detail-icon:hover {
    background-color: #005177;
}

/* ==========================================
   Paginación
   ========================================== */
.gjp-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.gjp-page-btn {
    background-color: #ffffff;
    color: #2d3748;
    border: 1.5px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gjp-page-btn:hover:not(:disabled) {
    border-color: #9f6e00;
    color: #9f6e00;
}

.gjp-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gjp-page-info {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
}

/* ==========================================
   Modal
   ========================================== */
.gjp-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 20px;
}

.gjp-modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 25px;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.gjp-close {
    position: absolute;
    right: 18px;
    top: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #a0aec0;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.gjp-close:hover {
    color: #2d3748;
}

.gjp-modal-avatar {
    width: 120px;
    height: 140px;
    border-radius: 8px;
    object-fit: cover;
    object-position: top center;
    border: 3px solid #0073aa;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.2);
    margin: 0 auto 12px auto;
    display: block;
    background-color: #f7fafc;
}

.gjp-card-details h3 {
    text-align: center;
    margin: 10px 0 15px 0;
    color: #1a202c;
    font-size: 1.25em;
    font-weight: 700;
}

.gjp-card-details p {
    margin: 8px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #edf2f7;
    font-size: 14px;
    color: #2d3748;
}

.gjp-card-details p strong {
    color: #4a5568;
}

.gjp-btn-back {
    margin-top: 18px;
    width: 100%;
    padding: 12px;
    background: #0073aa;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.gjp-btn-back:hover {
    background: #005177;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .gjp-search-box {
        gap: 6px;
    }
    
    .gjp-btn-search {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .gjp-modal-content {
        padding: 20px;
        margin: 10% auto;
    }
}