/*
 * FICHERO DE ESTILOS UNIFICADO PARA EL DASHBOARD DE OPENDATA
 * Contiene los estilos correctos para el header azul, footer, sidebar y tarjetas.
 */

:root {
    --primary-color: #336699;
    --secondary-color: #f6bb00;
    --dark-color: #333;
    --light-color: #f4f4f4;
    --white-color: #ffffff;
    --font-main: 'Roboto', sans-serif;
    --font-display: 'Roboto Condensed', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: var(--light-color);
    color: var(--dark-color);
}

.container {
    max-width: 1920px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* === HEADER AZUL UNIFICADO === */
.ubikua-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    color: var(--white-color);
}

.ubikua-header .logo img {
    height: 40px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 25px;
}

.main-nav a {
    color: var(--white-color);
    text-decoration: none;
    font-weight: 700;
    font-family: var(--font-display);
    text-transform: uppercase;
}

.main-nav .active a,
.main-nav a:hover {
    color: var(--secondary-color);
}

.btn-contact {
    background: var(--secondary-color);
    color: var(--dark-color);
    padding: 0.8rem 2rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 700;
    font-family: var(--font-display);
    text-transform: uppercase;
    transition: transform 0.3s, background-color 0.3s;
}

.btn-contact:hover {
    background: #ffcf40;
    transform: translateY(-3px);
}

/* === LAYOUT DEL DASHBOARD === */
.main-content {
    padding: 20px 0;
}

.page-container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
    color: var(--primary-color);
}

h3 {
    font-size: 1rem;
    color: #333;
}

hr {
    border: 0;
    border-top: 1px solid #ccc;
    margin: 40px 0;
}

.dashboard-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.dashboard-sidebar {
    width: 240px;
    flex-shrink: 0;
    background-color: var(--white-color);
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
}

.dashboard-sidebar h3 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.dashboard-sidebar ul {
    list-style: none;
}

.dashboard-sidebar .sidebar-link {
    display: block;
    padding: 10px 12px;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 5px;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.dashboard-sidebar .sidebar-link:hover {
    background-color: #f4f4f4;
}

.dashboard-sidebar .sidebar-link.active {
    background-color: var(--primary-color);
    color: #fff;
}

.dashboard-sidebar .sidebar-link i {
    margin-right: 10px;
    width: 20px;
}

#dashboard-main-content {
    flex-grow: 1;
    min-width: 0;
}

/* === TARJETAS DE GRÁFICOS Y DATOS === */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: var(--white-color);
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.chart-card > div[data-echart-instance],
.chart-card > .kpi-container {
    flex-grow: 1;
}

.chart-card h3 {
    margin: 0;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.chart-card-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.help-section {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-left: 4px solid var(--secondary-color);
    border-radius: 6px;
}

.help-section i {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-right: 12px;
    margin-top: 4px;
    width: 20px;
    text-align: center;
}

.help-section p {
    margin: 0;
    padding: 0;
    color: #555;
    font-size: 0.85rem;
    line-height: 1.5;
}

.help-section p strong {
    color: var(--primary-color);
    font-weight: 600;
}

.opendata-links { display: flex; gap: 8px; }
.opendata-links a { background: var(--primary-color); color: #fff; text-decoration: none; padding: 5px 10px; border-radius: 4px; font-size: 0.8rem; display: inline-flex; align-items: center; gap: 5px; }
.opendata-links a:hover { opacity: 0.9; }

/* === KPIs y MAPA === */
.kpi-container { display: flex; flex-direction: column; justify-content: space-around; align-items: center; }
.kpi-card { background: #f8f9fa; border: 1px solid #e9ecef; border-left: 4px solid var(--primary-color); padding: 20px; text-align: center; width: 80%; border-radius: 6px;}
.kpi-card .value { font-size: 2.5rem; font-weight: bold; color: var(--primary-color); }
.kpi-card .label { font-size: 1rem; color: #666; margin-top: 5px; }
#fullScreenMap { width: 100%; height: 80vh; }


/* === FOOTER UNIFICADO === */
.footer {
    background: var(--dark-color);
    color: var(--light-color);
    text-align: center;
    padding: 2rem;
    margin-top: 40px;
}
.footer a {
    color: var(--light-color);
    text-decoration: none;
}
/* ... al final de adeje/css/opendata.css ... */

/* Estilos para el estado de datos cacheados vs en vivo */
.chart-card h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.live-status {
    font-size: 0.8rem;
    font-weight: normal;
    color: var(--color-gris);
    background-color: #f0f2f5;
    padding: 4px 8px;
    border-radius: 12px;
}

.live-status i {
    margin-right: 5px;
}

/* Estilo para que los datos "obsoletos" se vean ligeramente diferentes */
.obsolete-data {
    opacity: 0.75;
    border-left: 5px solid var(--secondary-color);
    transition: opacity 0.5s ease;
}
/* ... al final de adeje/css/opendata.css ... */

.realtime-data-card.placeholder-card p span {
    background-color: #e0e0e0;
    color: transparent;
    border-radius: 4px;
    min-width: 50px; /* Evita que el esqueleto sea demasiado pequeño */
    display: inline-block; /* Permite aplicar el ancho */
}

.live-status {
    font-size: 0.8rem;
    font-weight: normal;
    color: var(--color-gris);
    background-color: #f0f2f5;
    padding: 4px 8px;
    border-radius: 12px;
}

.live-status i {
    margin-right: 5px;
}
/* ... al final de adeje/css/opendata.css ... */

/* Animación para el icono del spinner de Font Awesome */
@keyframes fa-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Aplicar la animación al icono dentro del estado de carga */
.live-status .fa-spin {
  animation: fa-spin 1s linear infinite;
}