html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* El contenido principal debe crecer para ocupar el espacio disponible */
main {
    flex: 1;
    padding: 20px 0;
}

/* El footer se mantendrá al final */
footer {
    margin-top: auto;
}
body {
    font-family: Arial, sans-serif;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header, footer {
    background-color: #1c4857;
    color: white;
    padding: 0 0 20px;
    text-align: center;
}
.link_profile {
    text-transform: capitalize;
    color: #1c4857;
    text-decoration: none;
    font-weight: bold;
}

.link {
    color: white;
    font-weight: bold;
}

.link:hover {
    opacity: 0.8;
}
.link_profile::first-letter {
    text-transform: uppercase;
}
.link_profile:hover {
    text-decoration: underline;
}
footer {
    padding: 20px 0;
}
.footer__cont {
    display:flex; 
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#logo {
    width: 100px;
    margin-right: 20px; 
}
.container{
    padding: 0 30px;
    width: calc(100% - 60px);
}

nav a {
    color: white;
    margin: 0 15px;
    text-decoration: none;
}

nav a:hover {
    text-decoration: underline;
    color: orange;
}

h1, h2, h3 {
    margin: 20px 0;
}

.title {
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}

.tournament_position {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.tournament_position select {
    margin-bottom: 0;
}
.form {
    background-color: white;
    padding: 20px 30px;
    margin: 20px auto;
    width: 800px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#sets {    
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0 20px;
}
.player_cont {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.player_item {
    width: 100%;
}

.set {
    width: 100%;
}
label {
    display: block;
    margin: 10px 0 5px;
}


input[type="text"], input[type="number"],input[type="email"], input[type="tel"],input[type="date"], select {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background-color: #f0f4f8;
    color: #333;
    font-size: 1rem;
    transition: all 0.3s;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    
}
input[type="text"], input[type="number"],input[type="email"], input[type="tel"],input[type="date"],input[type="password"]    {
    width: -webkit-fill-available;
}

input[type="submit"] {
    background-color: #1c4857;
    color: white;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
}

input[type="submit"]:hover {
    background-color: white;
    color: #1c4857;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    padding: 10px;
    border: 1px solid #ccc;
    text-align: left;
}

th {
    background-color: #1c4857;
    color: white;
}


h2 {
    color: #333;
}

h3 {
    color: #555;
}

h4 {
    font-weight: normal;
    color: #777;
}

p {
    font-size: 1rem;
    margin: 5px 0;
}

#delete-form {text-align: right;}
.button {
    display: inline-block;
    padding: 10px 15px;
    background-color: #1c4857; 
    color: white; 
    text-decoration: none; 
    border-radius: 5px; 
    cursor: pointer;
    border: 1px solid #1c4857;
    margin-top: 10px;
}

.button:hover {
    background-color: white; 
    color: #1c4857; 
    border: 1px solid #1c4857;
}

.swal2-icon.swal2-warning {
    border-color: #1c4857 !important; 
    color: #1c4857 !important;
}

.swal2-styled.swal2-confirm {
    background-color: #1c4857 !important; 
    color: white !important;
    border-color: #1c4857 !important; 
}
.swal2-styled.swal2-confirm:hover {
    background-color: white !important; 
    color: #1c4857 !important; 
    border-color: #1c4857 !important; 
}
.add_player__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.add_player__item .item {
    width: 100%;
}

/* Estilos para el mensaje después de registrar el partido */
.message {
    background-color: #f8f9fa;
    border: 2px solid #007bff;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    font-family: Arial, sans-serif;
    text-align: center;
}

.message p {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
}

.message strong {
    color: #007bff; 
}

.message .btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.message .btn:hover {
    background-color: #218838;
}


/* Estilo general de la sección */
.como-funciona {
    background-color: #f9f9f9;
    padding: 40px 0;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Títulos */
.section-title {
    font-size: 28px;
    color: #333;
    text-align: center;
    margin-bottom: 20px;
}

.sub-title {
    font-size: 22px;
    color: #555;
    margin-top: 30px;
    margin-bottom: 15px;
}

/* Descripción de la sección */
.section-description {
    font-size: 16px;
    color: #777;
    line-height: 1.6;
    text-align: center;
}

/* Tabla de puntos */
.points-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.points-table th,
.points-table td {
    padding: 15px;
    text-align: left;
    border: 1px solid #ddd;
}

.points-table th {
    background-color: #f5f5f5;
    font-weight: bold;
    color: #444;
}

.points-table td {
    font-size: 16px;
    color: #555;
}

.points-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.highlight {
    background-color: #e0f7fa;
    color: #00796b;
    font-weight: bold;
}

/* Lista de cálculos */
.calculation-list {
    list-style-type: none;
    padding: 0;
    font-size: 16px;
}

.calculation-list li {
    background-color: #f1f1f1;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-left: 5px solid #1c4857;
    font-weight: bold;
}

/* Estilos para la tabla de puntos por posición */
.position-points-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.position-options {
    display: flex;
    justify-content: space-between;
}

.position-label {
    margin-right: 10px;
}


.position-points-table th,
.position-points-table td {
    padding: 15px;
    text-align: left;
    border: 1px solid #ddd;
}

.position-points-table th {
    background-color: #f5f5f5;
    font-weight: bold;
    color: #444;
}

.position-points-table td {
    font-size: 16px;
    color: #555;
}

.position-points-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.position-points-table tr:hover {
    background-color: #e8f5e9;
}

.position-points-table td {
    font-weight: bold;
}

.cont_player {text-align: center}

/* Estilos generales para el contenedor del login */

.login {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80vh;
    background: #f7f7f7;
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4a90e2, #50b3a2);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
    color: #fff;
    text-align: center;
}

.login-title {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #fff;
    font-weight: 600;
    text-align: center;
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.form-group {
    margin-bottom: 15px;
}

.login-input {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background-color: #f0f4f8;
    color: #333;
    font-size: 1rem;
    transition: all 0.3s;
    box-sizing: border-box;
}

.login-input::placeholder {
    color: #999;
}

.login-input:focus {
    outline: none;
    background-color: #fff;
}

.login-button {
    padding: 12px;
    border: none;
    border-radius: 8px;
    background-color: #50b3a2;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-button:hover {
    background-color: #1c4857;
}

.header__log a {
    display: inline-block;
    padding: 10px 20px;
    font-size: 16px;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.header__log a:hover {
    background-color: #1c4857;
    border-color: white;
}

.logout-btn {
    background-color: #ff4d4d; 
    color: white;
    border: 1px solid #ff1a1a;
    width: 100%;
}

.logout-btn:hover {
    background-color: #ff1a1a;
    border-color: #ff0000;
}

.login-btn {
    background-color: #45a049;
    color: white;
    border: 1px solid #45a049;
}

.login-btn:hover {
    background-color: #45a049;
    border-color: #388e3c;
}

.header__log {
    margin: 20px;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
}

.match-list {
    list-style: none;
    padding: 0;
}

.match-list__item {
    background-color: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 10px;
}

.match-list__header {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    color: #333;
}

.match-list__details {
    color: #555;
}

.player-history__no-matches {
    text-align: center;
    font-size: 16px;
    color: #e74c3c;
}

.ranking_filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ranking_filter input {
    margin-bottom: 0;
}

.ranking_filter-tournament {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.ranking_filter-tournament select {
    min-width: 200px;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 1em;
}

.ranking_filter-tournament select:hover {
    border-color: #1c4857;
    background-color: #fff;
}

.ranking_filter-tournament select:focus {
    outline: none;
    border-color: #1c4857;
    box-shadow: 0 0 0 3px rgba(28,72,87,0.1);
}

.ranking__cont {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ranking_filter-forms {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
}

.ranking_filter-forms form {
    width: 50%;
}

#categoria {
    width: 200px;
    margin-bottom: 0;
}

.clear-filters-btn {
    background-color: #1c4857;
    color: white;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    text-decoration: none;
}

.clear-filters-btn:hover {
    background-color: white;
    color: #1c4857;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    font-family: 'Arial', sans-serif;
}

.pagination a {
    display: inline-block;
    padding: 10px 15px;
    background-color: #1c4857; 
    color: white; 
    text-decoration: none; 
    border-radius: 5px; 
    margin: 0 10px;
}

.pagination a:hover {
    background-color: #007bff;
    color: white;
}

.pagination span {
    font-size: 16px;
    margin: 0 5px;
    font-weight: bold;
}

.pagination a:disabled {
    color: #ddd;
    cursor: not-allowed;
    border-color: #ddd;
    background-color: #f8f9fa;
}

.pagination a:first-child,
.pagination a:last-child {
    font-weight: bold;
}

.pagination a.active {
    background-color: #007bff;
    color: white;
    pointer-events: none;
}

.pagination a.active:hover {
    background-color: #0056b3;
}

.tournament-details {
    margin-bottom: 80px
}
.podio-grid-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.podio-category {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.podio-title h4 {
    font-size: 1.6em;
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
    color: #333;
}

.podio-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
}


.podio-item p {
    margin: 10px 0;
}

.podio-item strong {
    font-size: 1.2em;
}
.podio-item {
    background-color: #f4f4f4;
    padding: 20px;
    text-align: center;
    border-radius: 10px;
    width: 250px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
    order: 0;
}

.podio-item i {
    font-size: 30px; 
    margin-bottom: 10px;
    display: block;
}

.podio-item.position-1 {
    background-color: gold; /* Color para el primer lugar */
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-20px); /* Eleva el primer lugar */
    z-index: 3; /* Lo pone por encima de los otros */
    order: 2; /* Coloca al primer lugar en la tercera posición */
    
}

.podio-item.position-2 {
    background-color: silver; /* Color para el segundo lugar */
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
    order: 1; /* Coloca al segundo lugar en la primera posición */
}

.podio-item.position-3 {
    background-color: #cd7f32; /* Color para el tercer lugar */
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
    order: 3; /* Coloca al tercer lugar en la última posición */
}

.cuarto-puesto {
    margin-top: 20px;
    font-style: italic;
}

.cuarto-item {
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    width: 350px;
    margin: 0 auto;
}

.cuarto-item p {
    margin: 5px 0;
}

.players_cont {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 20px;
}

/* Estilos generales para la sección del podio */
.player-podium {
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    margin-top: 30px;
}

.player-podium__title {
    font-size: 24px;
    color: #1c4857; 
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 20px;
    font-weight: bold;
}

/* Estilos de la lista */
.podium-list {
    list-style-type: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 0;
}

/* Estilo para cada item de la lista */
.podium-list__item {
    color: black;
    font-family: 'Arial', sans-serif;
    position: relative;
}

.podium-list__item p {
    margin: 10px 0;
    font-size: 1.1rem;
}

.podium-list__item strong {
    color: #1c4857; /* Color dorado para destacar las etiquetas */
}

/* Estilo para la posición */
.podium-list__item p strong {
    color: #1c4857; /* Dorado para las etiquetas */
}

/* Animación para el texto */
.podium-list__item p {
    animation: fadeIn 0.5s ease-out;
}

.categories-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.categories-form input[type="number"] {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: none;
    margin-bottom: 0;
}

.categories-form input:hover {
    border-color: #1c4857;
    background-color: #fff;
}

.categories-form input:focus {
    outline: none;
    border-color: #1c4857;
    box-shadow: 0 0 0 3px rgba(28,72,87,0.1);
}

.categories-form input[type="submit"] {
    background-color: #1c4857;
    color: white;
    border: 1px solid #1c4857;
}

.back-button {
    display: inline-block;
    padding: 10px 15px;
    background-color: #1c4857; 
    text-decoration: none; 
    border-radius: 5px; 
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #1c4857;
}

.back-button:hover {
    background-color: white;
}

.back-button a {
    text-decoration: none;
    color: white
}

.back-button:hover a {
    color: #1c4857;
}


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

/* Estilo para el mensaje cuando no hay resultados */
.player-podium__no-results {
    text-align: center;
    font-size: 1.2rem;
    color: #fff;
    font-style: italic;
}


@media (max-width: 1100px) {
    .header h1 {display: none;}
}

@media (max-width: 860px) {
    .players_cont {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}


/* Asegurarse de que el texto se vea bien en dispositivos pequeños */
@media (max-width: 768px) {
    .clear-filters-btn {width:100%;}
    .section-title {
        font-size: 24px;
    }

    .sub-title {
        font-size: 20px;
    }

    .points-table th,
    .points-table td {
        padding: 10px;
    }

    .section-description {
        font-size: 14px;
    }

    .position-points-table th,
    .position-points-table td {
        padding: 10px;
    }
}

@media (max-width: 680px) {
    .container {padding: 0 15px; margin: 0;}
    .login-container {
        padding: 20px;
    }
    .login-title {
        font-size: 1.8rem;
    }
    .login-button {
        font-size: 0.9rem;
    }
    .ranking__cont {
        flex-direction: column;
    }

    table {
        display: block;
        width: 100%;
        overflow-x: auto; /* Permite hacer scroll horizontal si la tabla es muy ancha */
        white-space: nowrap; /* Evita que el contenido se desborde en varias líneas */
    }

    #logo {width: 80px;}

    header {position: relative; padding: 0 0 40px}
    .header__cont {    position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;}
    nav { gap: 10px;
        margin: 10px 0;
        display: flex;
        align-items: center;
        justify-content: center;}
    nav a {margin: 0;}
    .position-points-table {width: 100%; justify-items: center; background-color: unset; box-shadow: none;}
    .header__log a {padding: 5px 10px; width: 100%;}

    .footer__cont {
        flex-direction: column;
        gap: 0;
    }

    .players_cont {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Estilos personalizados para Select2 */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: 58px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px;
    color: #333;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #1c4857;
}

.select2-dropdown {
    border: 1px solid #ddd;
}

.select2-search--dropdown .select2-search__field {
    padding: 8px;
    border: 1px solid #ddd;
}