.castillo-precio-luz {
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.castillo-precio-luz .precio-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.castillo-precio-luz.caro .precio-info span.precio{
    color:#E00000;
}

.castillo-precio-luz.barato .precio-info span.precio{
    color:#0A800A;
}

.castillo-precio-luz.medio .precio-info span.precio{
    color:#9E5F00;
}

.castillo-precio-luz .fecha {
    font-size: 0.9em;
    color: #000001;
    text-align: right;
}

.castillo-precio-luz-actual {
    background-color: #ffffff;
    color: #000000;
    padding: 10px;
    border: 1px solid;
    text-align: center;
    border-radius: 8px;
}

.castillo-precio-luz-actual .etiqueta.caro {
    color: red; /* Color rojo para CARO */
    font-weight: bold;
    margin-left: 10px;
}

.castillo-precio-luz-actual .etiqueta.medio {
    color: orange; /* Color naranja para MEDIO */
    font-weight: bold;
}

.castillo-precio-luz-actual .etiqueta.barato {
    color: green; /* Color verde para BARATO */
    font-weight: bold;
}

.castillo-precio-luz-actual .circulo {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%; /* Hace que el span sea un círculo */
    margin-right: 10px; /* Espacio entre el círculo y el texto */
}

.castillo-precio-luz-actual .circulo-verde {
    background-color: green; /* Círculo verde para BARATO */
}

.castillo-precio-luz-actual .circulo-naranja {
    background-color: orange; /* Círculo naranja para MEDIO */
}

.castillo-precio-luz-actual .circulo-rojo {
    background-color: red; /* Círculo rojo para CARO */
}

.castillo-precio-luz-actual .etiqueta {
    font-weight: bold;
}

.castillo-precio-luz.barato {
    background-color: #f8f9fb;
    color: black;
    border-left: 4px solid #0faf10;
}

.castillo-precio-luz.medio {
    background-color: #f8f9fb;
    color: black;
    border-left: 4px solid #FFA726;
}

.castillo-precio-luz.caro {
    background-color: #f8f9fb;
    color: black;
    border-left: 4px solid #f23c25;
}

.castillo-precio-luz-timeline {
    position: relative;
    margin: 20px 0;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

.grid-line {
    stroke: #e0e0e0;
    stroke-width: 1;
}

.precio-referencia {
    fill: #666;
    font-size: 12px;
}

.precio-linea {
    fill: none;
    stroke: #2196F3;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.precio-punto {
    fill: #2196F3;
    transition: r 0.2s;
}

.hora-label {
    fill: #666;
    font-size: 11px;
    text-anchor: middle;
}

.punto-grupo:hover .precio-punto {
    r: 6;
}

.tooltip {
    opacity: 0;
    transition: opacity 0.2s;
}

.punto-grupo:hover .tooltip {
    opacity: 1;
}

.tooltip rect {
    fill: rgba(0,0,0,0.8);
    rx: 5;
}

.tooltip text {
    fill: white;
    font-size: 12px;
}

span.hora {
    font-size: 25px;
    font-weight: bold;
}

.hora-actual {
    stroke: #ff4444;
    stroke-width: 2;
    stroke-dasharray: 4;
}

.hora-actual-label {
    fill: #ff4444;
    font-size: 18px;
    text-anchor: middle;
    font-weight: bold;
}

.ultima-actualizacion {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #007bff;
}

.ultima-actualizacion p {
    margin: 5px 0;
}

@media (max-width: 768px) {
    .castillo-precio-luz {
        flex-direction: column;
        text-align: center;
    }

    .castillo-precio-luz-timeline {
        padding: 10px;
		margin-bottom: 140px;
    }

    .precio-referencia {
        font-size: 10px;
    }

    .hora-label {
        font-size: 9px;
    }

    .tooltip text {
        font-size: 10px;
    }
}

.castillo-precio-luz-tabla table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.castillo-precio-luz-tabla th,
.castillo-precio-luz-tabla td {
    padding: 10px;
    text-align: left;
    border: 1px solid #ddd;
}

.castillo-precio-luz-tabla th {
    background-color: #f5f5f5;
}

/* Estilos para la página de administración */
.shortcode-card {
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    margin: 15px 0;
    border-radius: 5px;
}

.shortcode-card code {
    display: inline-block;
    background: #f5f5f5;
    padding: 5px 10px;
    border-radius: 3px;
    margin: 10px 0;
}

.precio-luz-tabla table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.precio-luz-tabla th,
.precio-luz-tabla td {
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
}

.precio-luz-tabla th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.precio-luz-tabla .precio-bajo {
    background-color: #E8F5E9;
    color: #2E7D32;
}

.precio-luz-tabla .precio-medio {
    background-color: #FFF3E0;
    color: #EF6C00;
}

.precio-luz-tabla .precio-alto {
    background-color: #FFEBEE;
    color: #C62828;
}

.precio-luz-tabla tr.precio-bajo {
    background-color: #e8f5e9;  /* Verde claro para precios bajos */
}

.precio-luz-tabla tr.precio-medio {
    background-color: #fff3e0;  /* Naranja claro para precios medios */
}

.precio-luz-tabla tr.precio-alto {
    background-color: #ffebee;  /* Rojo claro para precios altos */
}

.castillo-precio-luz.fecha,
.castillo-precio-luz.actualizacion {
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    margin: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.fecha-contenido,
.actualizacion-contenido {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fecha-icono,
.actualizacion-icono {
    font-size: 1.2em;
}

.fecha-label,
.actualizacion-label {
    font-weight: bold;
    color: #666;
    margin-right: 10px;
}

.fecha-valor,
.actualizacion-valor {
    color: #0076d3;
    font-weight: 500;
}

.castillo-precio-luz.actualizacion .actualizacion-valor {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.castillo-precio-luz.actualizacion .actualizacion-valor.loaded {
    opacity: 1;
}

.cron-info {
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.cron-info table {
    margin-top: 10px;
}

.cron-info th {
    text-align: left;
}

.cron-info td, 
.cron-info th {
    padding: 8px;
}

@media (max-width: 768px) {
    .fecha-contenido,
    .actualizacion-contenido {
        /*
        flex-direction: column;
        align-items: flex-start;
        */
        gap: 5px;
    }
}

.castillo-precio-luz-loading {
    position: relative;
}

.castillo-precio-luz-loading:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    display: none;
}

.castillo-precio-luz-loading.updating:after {
    display: block;
}

.precio-placeholder,
.etiqueta-placeholder {
    color: #666;
    font-style: italic;
}

.castillo-precio-luz-actual.updating {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.precio-loading {
    color: #666;
    font-style: italic;
    margin-left: 5px;
    color: red;
    font-weight: bold;
}

.circulo-gris {
    background-color: #999; /* Color gris para el estado de carga */
}

/* Animación de carga */
.precio-loading:after {
    content: "...";
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

.mensaje-carga {
    color: #666;
    font-style: italic;
    padding: 20px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 8px;
}

.mensaje-carga:after {
    content: "...";
    animation: loading 1.5s infinite;
}

.mensaje-no-disponible {
    padding: 20px;
    background: #f8f9fb;
    border: 1px solid #f8f9fb;
    border-radius: 8px;
    color: black;
}

.castillo-precio-luz .ver-manana {
    margin-top: 10px;
    text-align: center;
    display: block; /* Asegurarnos que sea visible */
}

.castillo-precio-luz .boton-ver-manana {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background-color: red;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.castillo-precio-luz .boton-ver-manana:hover {
    background-color: #0056b3;
    color: white;
    text-decoration: none;
}

/* Animación para cuando el botón aparece */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.castillo-precio-luz .ver-manana {
    animation: fadeIn 0.5s ease-in;
}

/* Estilos para el botón Ver precios de HOY */
.castillo-precio-luz.fecha .ver-hoy {
    margin-top: 15px;
    text-align: center;
}

.castillo-precio-luz.fecha .ver-hoy .boton-ver-manana {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.castillo-precio-luz.fecha .ver-hoy .boton-ver-manana:hover {
    background-color: #0056b3;
    color: white;
    text-decoration: none;
}

.loading {
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.error {
    color: red;
    text-align: center;
    padding: 20px;
}

.precio-luz-historicos {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.year-selector {
    margin-bottom: 30px;
    text-align: center;
}

.year-selector select {
    padding: 8px 15px;
    font-size: 16px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.precio-luz-extremos {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
    margin-bottom: 30px;
    text-align: center;
    width: 100%;
}

.precio-luz-extremos > div {
    flex: 1;
    min-width: 250px;
    max-width: 100%;
    padding: 20px;
    border-radius: 8px;
    background: #f8f9fa;
    margin: 0 10px;
}

.precio-luz-extremos .precio-max {
    border-left: 4px solid #dc3545;
}

.precio-luz-extremos .precio-min {
    border-left: 4px solid #28a745;
}

.precio-luz-extremos .precio {
    font-size: clamp(20px, 4vw, 24px);
    font-weight: bold;
    margin: 10px 0;
    word-break: break-word;
}

.precio-luz-extremos h3 {
    font-size: clamp(16px, 3vw, 20px);
    margin-bottom: 10px;
}

.precio-luz-extremos .mes {
    font-size: clamp(14px, 2.5vw, 16px);
}

.precio-luz-extremos .precio-max .precio {
    color: #dc3545;  /* Rojo para el precio más alto */
}

.precio-luz-extremos .precio-min .precio {
    color: #28a745;  /* Verde para el precio más bajo */
}

/* Ajustes específicos para móvil */
@media (max-width: 768px) {
    .precio-luz-extremos {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .precio-luz-extremos > div {
        margin: 0;
        min-width: unset;
    }
}

/* Ajustes para pantallas muy pequeñas */
@media (max-width: 360px) {
    .precio-luz-extremos > div {
        padding: 15px 10px;
    }
}

.precio-luz-timeline {
    margin: 30px 0;
    height: 400px;
}

.precio-luz-tabla.historico {
    margin-top: 60px;  /* Quitamos el margen superior */
}

.precio-luz-tabla table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.precio-luz-tabla th,
.precio-luz-tabla td {
    padding: 12px;
    text-align: center;
    border: 1px solid #ddd;
}

.precio-luz-tabla th {
    background: #f8f9fa;
    font-weight: bold;
}
/*
.precio-luz-tabla tr:nth-child(even) {
    background: #f8f9fa;
} 
*/

.precio-luz-tabla-manana {
    margin-top: 0;  /* Quitamos el margen superior */
}

.precio-luz-tabla-manana table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.precio-luz-tabla-manana th,
.precio-luz-tabla-manana td {
    padding: 12px;
    text-align: center;
    border: 1px solid #ddd;
}

.precio-luz-tabla-manana th {
    background: #f8f9fa;
    font-weight: bold;
}

.precio-luz-tabla-manana tr:nth-child(even) {
    background: #f8f9fa;
}

.precio-luz-tabla-manana tr.precio-bajo {
    background-color: #e8f5e9;  /* Verde claro para precios bajos */
    color: #2E7D32;  /* Verde oscuro para el texto */
}

.precio-luz-tabla-manana tr.precio-medio {
    background-color: #fff3e0;  /* Naranja claro para precios medios */
    color: #EF6C00;  /* Naranja oscuro para el texto */
}

.precio-luz-tabla-manana tr.precio-alto {
    background-color: #ffebee;  /* Rojo claro para precios altos */
    color: #C62828;  /* Rojo oscuro para el texto */
}

.castillo-precio-luz.actualizacion {
    background-color: #f8f9fb;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.castillo-precio-luz.actualizacion .estado-inicial {
    text-align: center;
    width: 100%;
}

.castillo-precio-luz.actualizacion .estado-inicial p {
    margin: 0;
    display: inline-block;
}

.castillo-precio-luz.actualizacion .actualizacion-wrapper {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
}

.castillo-precio-luz.actualizacion .actualizacion-datos {
    text-align: right;
}

.castillo-precio-luz.actualizacion .actualizacion-label {
    text-align: left;
}

.castillo-precio-luz.actualizacion .actualizacion-fecha {
    font-size: 15px;
    font-weight: bold;
    margin: 0;
} 