/* styles.css */

html {
    user-select: none;
    /* Evita la selección de texto al hacer doble clic */
    touch-action: manipulation;
    /* Desactiva las acciones de zoom táctil en dispositivos móviles */
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f0;
    color: #333;
    margin: 0;
}

/* Estilos para el contenedor principal */
.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 500px;
    /* Ajusta el ancho máximo según sea necesario */
    margin: 0 auto;
}

/* Estilos para los botones adicionales */
.button-container {
    margin-top: 20px;
    text-align: center;
}

#showLoadGameBtn,
#showNewGameBtn,
#showHistoryBtn,
#loadSelectesGameBtn,
#showGameChartBtn,
#showResultsBtn,
#showLiveGameBtn,
#loadLiveGameBtn {
    margin: 5px 0;
    /* Espaciado vertical entre botones */
    padding: 10px 20px;
    /* Tamaño del botón */
    font-size: 1em;
    /* Tamaño de la fuente */
    border-radius: 5px;
    /* Bordes redondeados */
    cursor: pointer;
    /* Cambiar el cursor al pasar por encima */
    transition: background-color 0.3s ease-in-out;
    /* Transición suave */
    width: 200px;
    /* Ancho fijo para ambos botones */
    text-align: center;
    /* Centrar el texto */
}

#showLoadGameBtn,
#showResultsBtn {
    background-color: #6c757d;
    /* Color gris */
    color: white;
    border: none;
}

#showLoadGameBtn:hover,
#showResultsBtn:hover {
    background-color: #5a6268;
    /* Color gris más oscuro al pasar el ratón */
}

#showNewGameBtn {
    background-color: #28a745;
    /* Color verde */
    color: white;
    border: none;
}

#showNewGameBtn:hover {
    background-color: #218838;
    /* Color verde más oscuro al pasar el ratón */
}

#showLiveGameBtn {
    background-color: #ff0000;
    /* Color rojo */
    color: white;
    border: none;
}

#showHistoryBtn,
#showGameChartBtn {
    background-color: #0dcaf0;
    /* Color gris */
    color: white;
    border: none;
}

#showHistoryBtn:hover,
#showGameChartBtn:hover {
    background-color: rgb(101, 215, 238);
    /* Color gris más oscuro al pasar el ratón */
}

.list-left {
    text-align: left;
}

/* Contenedor principal del setup */
#setup {
    max-width: 500px;
    /* Ancho máximo */
    width: 90%;
    /* Adapta a pantallas pequeñas */
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin: 70px auto 10px auto;
    /* Centrado horizontal */
    text-align: center;
}

/* Títulos */
#setup h1 {
    font-size: 1.8em;
    margin-bottom: 20px;
}

h1.text-marcador {
    color: red;
    font-weight: bolder;
}

/* Etiquetas */
#setup label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

/* Inputs y select: Misma apariencia */
#setup input,
#setup select,
#configModal input {
    width: 250px;
    /* Ocupa todo el espacio disponible */
    padding: 10px;
    /* Espaciado interno */
    margin-bottom: 15px;
    /* Separación entre los elementos */
    border: 1px solid #ccc;
    /* Borde uniforme */
    border-radius: 5px;
    /* Bordes redondeados */
    box-sizing: border-box;
    /* Asegura que padding y border no afecten al ancho total */
    font-size: 1em;
    /* Tamaño de fuente uniforme */
    appearance: none;
    /* Estilo nativo del select desactivado */
}

#configModal input {
    width: 100px;
    /* Ocupa todo el espacio disponible */

}

/* Botón de iniciar partida */
#setup button {
    font-size: 1.2em;
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    color: white;
    background-color: #007bff;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
}

#setup button:hover {
    background-color: #0056b3;
}

/* Asegura que el contenedor sea responsive */
.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    padding: 10px;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: .5rem;
}

h6 {
    margin-bottom: 0px;
}

label {
    font-weight: bold;
}

button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}

.hidden {
    display: none;
}

.dau-indicator {
    position: relative;
    width: 15px;
    height: 15px;
    margin: 0 5px;
}

/* Estilo base para los cuartos del círculo */
.quarter {
    position: absolute;
    width: 9px;
    /* La mitad del tamaño del círculo */
    height: 9px;
    /* La mitad del tamaño del círculo */
    background-color: brown;
    animation: fade-in-out 4s infinite;

    /* Animación de degradado de opacidad */
}

/* Primer cuarto (superior izquierdo) */
.quarter-1 {
    top: 0;
    left: 0;
    border-top-left-radius: 100%;
    /* Bordes redondeados para formar un cuarto de círculo */
}

/* Segundo cuarto (superior derecho) */
.quarter-2 {
    top: 0;
    left: 10px;
    /* Alineado con el borde derecho del primer cuarto */
    border-top-right-radius: 100%;
    /* Bordes redondeados para formar un cuarto de círculo */
}

/* Tercer cuarto (inferior izquierdo) */
.quarter-3 {
    top: 10px;
    /* Alineado con el borde inferior del primer cuarto */
    left: 0;
    border-bottom-left-radius: 100%;
    /* Bordes redondeados para formar un cuarto de círculo */
}

/* Cuarto cuarto (inferior derecho) */
.quarter-4 {
    top: 10px;
    /* Alineado con el borde inferior del segundo cuarto */
    left: 10px;
    /* Alineado con el borde derecho del tercer cuarto */
    border-bottom-right-radius: 100%;
    /* Bordes redondeados para formar un cuarto de círculo */
}

/* Posicionamiento específico para #dauIndicator1 */
#dauIndicator1, #dauIndicator1-live {
    position: relative;
    display: inline-block;
}

/* Posicionamiento específico para #dauIndicator2 */
#dauIndicator2, #dauIndicator2-live {
    position: relative;
    display: inline-block;
}

.old-vers {
    color: #aaa;
}
/* Contenedor principal */
.scoreboard {
    max-width: 500px;
    /* Ancho máximo de 500 px */
    width: 100%;
    /* Se adapta al ancho disponible en pantallas pequeñas */
    border: 2px solid #000;
    padding: 10px 20px 20px;
    border-radius: 10px;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.score,
.games {
    font-size: 3rem;
    color: white;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    line-height: 100px;
    text-align: center;
    margin: 5px 20px;
}

.media {
    font-size: 1.2rem;
    color: black;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    line-height: 40px;
    text-align: center;
    margin: 10px;
    background-color: yellow;
}
span#games2 {
    margin-right: 10px;
}
span#games1 {
    margin-left: 10px;
}

#resetBtn,
#undoBtn,
#mediaBtn {
    font-size: 1rem;
    width: 100%;
    max-width: 300px;
}

/* Indicador de Falta */
.falta-indicator,
.jocs-indicator {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 33px;
    font-size: 1.2em;
    background-color: #ffc107;
    color: #000;
    border-radius: 10PX;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
    border-radius: 50px;
    position: relative;
    top: -57px;
}

.jocs-indicator {
    top: 18px;
    width: 40px;
    height: 40px;
    line-height: 40px;
}

#jocs-indicator,
#jocs-indicator-live {
    height: 0px;
}

.live-indicator {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 32px;
    font-size: 1.2em;
    background-color: red;
    color: #fff;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
    border-radius: 50px;
    top: 23px;
    left: 10px;
    position: absolute;
    /* Configuración inicial */
    opacity: 0;
    /* Comienza invisible */
    animation: fade-in-out 4s infinite;
    /* Animación de 4 segundos (2s apareciendo + 2s desapareciendo) */
}

/* Definición de la animación */
@keyframes fade-in-out {

    0%,
    100% {
        opacity: 0;
        /* Invisibilidad al inicio y al final */
    }

    25%,
    75% {
        opacity: 1;
        /* Visibilidad en el medio */
    }
}

div#points,
div#points-live {
    margin-top: -40px;
}

/* Ocultar cuando esté inactivo */
.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
}

/* Mostrar con animación */
.falta-indicator:not(.hidden) {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Botones */
button {
    font-size: 1em;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    opacity: 0.9;
}

div#points button,
div#points-live button {
    padding: 40px 5px;
    width: 50%;
}

/* Botones de control */
#mediaBtn {
    background-color: #ffc107;
    color: #000;
}

#undoBtn {
    background-color: #28a745;
    color: #fff;
}

#resetBtn {
    background-color: #dc3545;
    color: #fff;
}

/* Estilos para los botones adicionales */
.container.text-center.mt-4 {
    margin-top: 20px;
    text-align: center;
}

/* Estilos para la ventana modal */
.modal {
    display: none;
    /* Ocultar por defecto */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    /* Fondo oscuro */
}

.modal.hidden {
    display: none;
    /* Ocultar el modal */
}

.modal:not(.hidden) {
    display: block;
    /* Mostrar el modal */
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 95%;
    max-width: 1200px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    display: block;
}

/* Estilos para el botón de confirmación */
#configModalButton {
    background-color: #007bff;
    /* Color azul */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
}

#configModalButton:hover {
    background-color: #0056b3;
    /* Color azul más oscuro al pasar el ratón */
}

.chart-height {
    height: 65%;
}

.d-flex.justify-content-center.gap-2.mt-3 {
    max-width: 100%;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#gameChart {
    display: block;
    width: 100% !important;
    height: 95% !important;
    max-width: 100%;
}

#historyContent {
    max-height: 400px;
    overflow-y: auto;
}

#userGamesContent {
    font-size: 0.9rem;
}

/* Estilos para los checkboxes personalizados */
#configModal input[type="checkbox"] {
    display: none;
    /* Ocultar el checkbox por defecto */
}

#configModal input[type="checkbox"]+label {
    position: relative;
    padding-left: 35px;
    /* Espacio para el checkbox personalizado */
    cursor: pointer;
    font-size: 1em;
    color: #333;
    display: inline-block;
    margin-bottom: 10px;
}

/* Estilo del checkbox personalizado */
#configModal input[type="checkbox"]+label:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    border: 2px solid #007bff;
    /* Borde azul */
    border-radius: 5px;
    /* Bordes redondeados */
    background-color: #fff;
    transition: background-color 0.3s ease-in-out, border-color 0.3s ease-in-out;
}

/* Estilo del checkbox cuando está marcado */
#configModal input[type="checkbox"]:checked+label:before {
    background-color: #007bff;
    /* Fondo azul cuando está marcado */
    border-color: #007bff;
}

/* Estilo del "check" dentro del checkbox */
#configModal input[type="checkbox"]+label:after {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    width: 8px;
    height: 14px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    /* Inicialmente oculto */
    transition: opacity 0.3s ease-in-out;
}

/* Mostrar el "check" cuando el checkbox está marcado */
#configModal input[type="checkbox"]:checked+label:after {
    opacity: 1;
}

/* Estilos para los labels de los checkboxes */
#configModal label {
    font-weight: bold;
    margin-bottom: 15px;
    display: block;
}

/* Estilos para el contenedor de los checkboxes */
#configModalContent {
    margin-bottom: 20px;
}

/* Estilos para el modal de notificación */
#liveNotificationModal .modal-content {
    max-width: 400px;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
}

#liveNotificationModal .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

#liveNotificationModal .close:hover {
    color: black;
}

#liveNotificationModal h2 {
    margin-bottom: 20px;
}

#liveNotificationModal p {
    margin-bottom: 20px;
    font-size: 1.2em;
}

#liveNotificationModal .btn {
    padding: 10px 20px;
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
}

.red {
    color: red;
}

#liveNotificationModal .btn-success {
    background-color: #28a745;
    color: white;
    border: none;
}

#liveNotificationModal .btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
}

/* Estilos para el modal de notificación de novedades */
#newsNotificationModal .modal-content {
    max-width: 400px;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
}

#newsNotificationModal .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

#newsNotificationModal .close:hover {
    color: black;
}

#newsNotificationModal h2 {
    margin-bottom: 20px;
}

#newsNotificationModal p {
    margin-bottom: 5px;
    font-size: 1em;
}

#newsNotificationModal .btn {
    padding: 10px 20px;
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
}

#newsNotificationModal .ul-version {
    font-size: 0.8em;
}

.team-container input[type="radio"] {
    margin-left: 10px;
    width: 13px !important;
    appearance: auto !important;
}

.mod-container {
    margin-left: -25px;
}

.radio-container {
    position: relative;
    /* Crea un contexto de posicionamiento relativo */
    display: inline-block;
    /* Asegura que el contenedor ocupe solo el espacio necesario */
}

.treta-text {
    position: absolute;
    left: 10%;
    transform: translateY(-50%);
    margin-left: 5px;
    font-size: 0.9em;
    top: -27px;
    width: 43px;
    font-weight: bold;
}

/* ===== MENÚ HAMBURGUESA ESTILO ADMIN CORRECTO Y FUNCIONAL ===== */

/* Fuente del icono */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-size: 30px;
    line-height: 1;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    user-select: none;
    transition: color 0.3s ease, left 0.3s ease;
}

/* Icono base del menú (hamburguesa) */
.menu-icon {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1001;
    padding: 10px;
    cursor: pointer;
    background-color: transparent;
    color: black; /* icono por defecto negro */
    transition: left 0.3s ease, color 0.3s ease;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 250px;
    height: 100%;
    position: fixed;
    top: 0;
    left: -250px;
    background-color: rgba(51, 51, 51, 0.95); /* 0.8 = 80% opaco, 20% transparente */
    padding-top: 60px;
    transition: left 0.3s ease;
    z-index: 1000;
}

/* Mostrar el sidebar */
.sidebar.active {
    left: 0;
}

/* Enlaces dentro del menú */
.sidebar a {
    padding: 10px 15px;
    display: block;
    font-size: 18px;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
}

.sidebar a:hover {
    background-color: #575757;
}

/* ===== ESTADO CUANDO EL MENÚ ESTÁ ABIERTO ===== */

/* Mover el icono hacia la derecha (dentro del menú) */
.sidebar.active ~ #menuToggle {
    left: 210px; /* dentro del menú (250px ancho - margen) */
}

/* Cambiar el color SOLO si está en modo X (añadido desde JS) */
#menuToggle.close-icon {
    color: white;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .menu-icon {
        display: block;
    }

    .sidebar {
        left: -250px;
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar.active ~ #menuToggle {
        left: 210px;
    }
}

@media (max-width: 768px) {
    button {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    button {
        font-size: 0.8rem;
    }

    h1 {
        font-size: 1.2rem;
    }
}

/* Estilos específicos para Safari en iPhone */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    #configModal input[type="checkbox"]+label:before {
        -webkit-appearance: none;
        /* Desactivar el estilo predeterminado de Safari */
        appearance: none;
    }

    #configModal input[type="checkbox"]:checked+label:before {
        -webkit-appearance: none;
        /* Desactivar el estilo predeterminado de Safari */
        appearance: none;
    }
}