html, body {
    height: 110%;
    margin: 0;
    padding: 0;
}
/* === ESTILOS GENERALES === */
body {
    font-family: 'Poppins', sans-serif;
    color: #2c1a4a;
    margin: 0;
    padding: 2rem;
    min-height: 100vh;

    display: flex;
    flex-direction: row; /* columnas horizontal */
    gap: 2rem;           /* espacio entre columnas */
    align-items: stretch; /* estira columnas verticalmente */
}

/* === COLUMNA IZQUIERDA: FORMULARIO === */
.colum {
    flex: 1; /* ancho proporcional */
    max-width: 450px;
    display: flex;
    flex-direction: column;
    gap: 1rem;

    background: linear-gradient(145deg, #fdb927 40%, #ffffff 80%);
    padding: 1.5rem;
    border-radius: 15px;

    height: 100%; /* ocupa todo el alto disponible */
}
#newPlayerForm{
    display: none;
}
/* Cada fila del formulario */
.colum .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
/* Etiquetas */
.colum label {
    color: #2c1a4a; /* texto negro */
    font-weight: 500;
    margin-bottom: 0.3rem;
}

/* Inputs */
.colum input, select{
    padding: 0.5rem 0.8rem;
    border-radius: 10px;
    border: 1px solid #2c1a4a; /* borde negro */
    background-color: #fff; /* fondo blanco */
    color: #2c1a4a; /* texto negro */
    font-size: 1rem;
    outline: none;
    transition: border 0.3s ease, background 0.3s ease;
}
.enviar-form,
.add-player .show-form, #f_surname{
    background: #552583;
    color: #fff;
    border: none;
    border-top: 3px solid #fdb927;
    padding: 0.7rem 1.5rem;
    width: 85%;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    border-radius: 15px;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.enviar-form:hover,
.add-player .show-form:hover, #f_surname:hover{
    font-weight: bold;
    transform: translateY(-2px);
    background: #32115a;
}



.enviar-form,
.add-player .show-form{
    margin-left: 20px;
}
/* === COLUMNA DERECHA: TÍTULO + JUGADORES centrados === */
.right-section {
    flex: 3;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;

    justify-content: flex-start; /* arriba */
    align-items: flex-start;     /* izquierda */
    padding: 1rem;               /* opcional, para separar del borde */
}

/* Título centrado horizontalmente */
.main-title {
    text-align: center; /* ahora centrado en la columna */
}

/* === TÍTULO PRINCIPAL === */
.main-title {
    text-align: left; /* izquierda dentro de la columna derecha */
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #fdb927;
    text-shadow: 0 0 15px rgba(253, 185, 39, 0.6);
}
#controls {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
}
#back, #next{
    background: #552583;
    color: #fff;
    border: none;
    border-top: 3px solid #fdb927;
    width: 85%;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    border-radius: 5px;
    box-sizing: border-box;
    margin-bottom: 10px;
}
#back:hover, #next:hover{
    font-weight: bold;
    transform: translateY(-2px);
    background: #32115a;
}
/* === CONTENEDOR DE JUGADORES === */
.players-container{
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; /* alineado a la izquierda dentro de la derecha */
    gap: 2rem;
    width: 100%;
    max-width: 1300px;
}

/* === TARJETA DE JUGADOR === */
.player-card {
    display: block;
    background: linear-gradient(145deg, #fdb927 40%, #ffffff 85%);
    color: #2c1a4a;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    width: 260px;
    text-align: center;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    opacity: 0;
    animation: fadeIn 0.8s forwards;
}

/* Animación de entrada */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Efecto hover */
.player-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

/* Imagen del jugador */
.player-card img {
    width: 100%;
    height: 280px;
    border-bottom: 4px solid #552583;
}

/* Nombre del jugador */
.player-card h1.name {
    font-size: 1.4rem;
    margin: 0.8rem 0 0.5rem;
    color: #552583;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Lista de atributos */
.player-card ul.atribute {
    padding: 0;
    margin: 0.5rem 0 1rem;
}

.player-card ul.atribute li {
    margin: 0.4rem 0;
    font-weight: 500;
    font-size: 0.95rem;
    color: #2c1a4a;
}
.player-card ul.atribute li::before {
    display: inline-block;
    margin-right: 6px;
}
.player-card ul.atribute li.jersey::before{
    content: "Jersey: ";
}
.player-card ul.atribute li.position::before{
    content: "Position: ";
}
.player-card ul.atribute li.age::before{
    content: "Age: ";
}
.player-card ul.atribute li.pointsPerGame::before{
    content: "Points per game: ";
}

/* Estilo base para ambos botones */
.player-card .remove-player,
.player-card .edit-player,
.player-card .edit-name{
    background: #552583;
    color: #fff;
    border: none;
    border-top: 3px solid #fdb927;
    padding: 0.7rem 1.5rem;
    width: 85%;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    border-radius: 15px;
    box-sizing: border-box;
    margin-bottom: 10px;
}

/* Efecto hover general */
.player-card .remove-player:hover,
.player-card .edit-player:hover,
.player-card .edit-name:focus{
    font-weight: bold;
    transform: translateY(-2px);
}

.player-card .remove-player,
.player-card .edit-player,
.player-card .edit-name,
.submitForm .enviar-form,
.add-player .show-form{
    background: #552583;
    border-top: 3px solid #fdb927;
}

.player-card .remove-player:hover,
.player-card .edit-player:hover,
.player-card .edit-name:focus,
.submitForm .enviar-form:hover,
.add-player .show-form:hover{
    background: #32115a;
}
.submitForm .enviar-form,.add-player .show-form{
    margin-left: 20px;
}
.player-card .edit-name{
    display: none;
    margin-left: 20px;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    body {
        flex-direction: column; /* columnas apilan en móviles */
        align-items: center;
    }
    .colum {
        max-width: 100%;
        width: 100%;
        margin-bottom: 2rem;
    }
    .right-section {
        flex: 1;
        width: 100%;
    }
    .players-container {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .main-title {
        font-size: 2.2rem;
    }

    .player-card {
        width: 90%;
        max-width: 340px;
    }

    .players-container {
        gap: 1.5rem;
    }
}
