body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    text-align: center;
    padding-top: 70px;
    padding: 30px;
}

h1 {
    color: #333;
}

table {
    width: 100%;
    margin: 20px auto;
    border-collapse: collapse;
    background: white;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.table-responsive {
    width: 90%;
    /* O el ancho que quieras */
    margin: 0 auto;
    /* Centrar si gustas */
    overflow-x: auto;
    /* 🔑 Activa el scroll horizontal */
    -webkit-overflow-scrolling: touch;
    /* Para "momentum" scroll en iOS */
}


thead {
    background: #007bff;
    color: white;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: center;
}

tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

tbody tr:hover {
    background-color: #e3f2fd;
    transition: 0.3s;
}

canvas {
    background: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

#controls {
    margin-bottom: 15px;
    text-align: center;
}

#dateSelector {
    padding: 8px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

#difference-container {
    display: flex;
    flex-wrap: wrap;
    /* Permite que las cajas bajen a la siguiente línea */
    justify-content: center;
    gap: 20px;
    margin: 20px auto;
}

/* Ajustar tamaño de las cajas en pantallas muy pequeñas */
@media (max-width: 600px) {
    .difference-box {
        width: 100%;
        /* O un ancho menor */
        max-width: 300px;
        /* Controla el ancho máximo si deseas */
        margin-bottom: 10px;
        /* Separación vertical */
    }
}

.difference-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 60px;
    padding: 10px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    background: white;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

.label {
    font-size: 14px;
    color: #666;
}

.value {
    font-size: 22px;
}

.green-text {
    color: green;
}

.red-text {
    color: red;
}


/* Fondo de carga que cubre toda la pantalla */
.spinner-overlay {
    display: none;
    /* Oculto por defecto */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    /* Fondo semi-transparente */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    /* Asegura que esté por encima de todo */
}

/* Contenedor del spinner */
.spinner-container {
    text-align: center;
}

/* Estilo del spinner */
.spinner {
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-left-color: #007bff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Estilo del texto "Cargando datos..." */
.spinner-container p {
    margin-top: 10px;
    font-size: 18px;
    color: #333;
    font-weight: bold;
}

.trend-up {
    color: green;
    font-weight: bold;
}

.trend-down {
    color: red;
    font-weight: bold;
}

.trend-neutral {
    color: gray;
    font-weight: bold;
}





#scale-container {
    width: 50%;
    margin: 20px auto;
    text-align: center;
    min-width: 80%;
    /* Ancho mínimo para pantallas pequeñas */
    max-width: 1000px;
    /* Opcional: limitar el ancho máximo */
}

.scale-label {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.scale-bar {
    position: relative;
    width: 100%;
    height: 40px;
    /* Ajustamos los stops para dar más espacio a los colores verdes y rojos */
    background: linear-gradient(to left,
            darkgreen 0%,
            lightgreen 45%,
            /* Más espacio en verde */
            yellow 50%,
            /* Reducimos el espacio del amarillo */
            lightcoral 55%,
            /* Más espacio para la zona rojiza */
            darkred 100%);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}


#scale-indicator {
    position: absolute;
    top: 0;
    width: 10px;
    height: 100%;
    background: black;
    border-radius: 5px;
    transition: left 0.5s ease-in-out;
}

/* 🔹 Estilos para las marcas y etiquetas */
.scale-ticks {
    position: absolute;
    width: 100%;
    top: 22px;
    /* Ajusta la posición de los números */
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #333;
    font-weight: bold;
}

.tick {
    position: absolute;
    transform: translateX(-50%);
    text-align: center;
    bottom: -10px;
}

/* 🔹 Rayitas verticales */
.tick::before {
    content: "";
    display: block;
    width: 2px;
    height: 10px;
    background: black;
    margin: 0 auto;
}


#chart-container {
    width: 90%;
    /* El contenedor ocupará el 90% del ancho disponible */
    max-width: 90%;
    /* Evita que se haga más ancho que 1000px */
    margin: 0 auto;
    /* Centra el contenedor horizontalmente */
    /* Sin altura fija ni "padding-bottom" si no quieres una proporción específica */
}


#chart-containerSmall {
    width: 90%;
    /* El contenedor ocupará el 90% del ancho disponible */
    max-width: 90%;
    margin: 0 auto;
    height: 300px;


}

#chart {
    display: block;
    /* Evita comportamientos inline */
    width: 100%;
    /* Ocupa el 100% del contenedor (que es del 90% de la página) */
    height: auto;
    /* Mantiene la proporción */
}


.market-status {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 16px;
    text-transform: uppercase;
    color: #fff;
    /* texto en blanco */
    z-index: 9999;

}

/* El estilo cuando está LIVE */
.market-live {
    background-color: red;
    animation: blink 1s infinite alternate;
    /* Parpadeo */
}

/* Estilo cuando está cerrado */
.market-closed {
    background-color: #666;
    /* gris */
    animation: none;
    /* sin parpadeo */
}

/* Animación de parpadeo */
@keyframes blink {
    from {
        opacity: 1;
    }

    to {
        opacity: 0.2;
    }
}

.hidden {
    display: none;
}

.modal-body {
    max-height: 400px;
    /* Fija la altura máxima */
    overflow-y: auto;
    /* Activa el scroll vertical cuando sea necesario */
}


/* Black Top Bar Styling */
.top-bar {
    background-color: #000;
    color: white;
    padding: 10px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: auto;
    z-index: 1001;
    display: flex;
    justify-content: space-between;
    /* El título a la izquierda y los botones a la derecha */
    align-items: center;
    height: 50px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Estilo del encabezado dentro de la franja negra */
.header-title {
    font-size: 24px;
    margin: 0;
    padding-left: 20px;
    color: white;
}

body {
    padding-top: 60px;
    /* Ajusta este valor según la altura de la barra */
}

#datePicker {
    width: 150px;
    /* Ajusta el ancho según lo que necesites */
    text-align: center;
    /* Centra el texto dentro del input */
}
