/* =================================================================
   style.css - DISEÑO PROFESIONAL PARA DASHBOARD "TODO EN UNO"
   ================================================================= */

:root {
    --strava-orange: #FC5200;
    --text-dark: #232323;
    --text-medium: #595959;
    --text-light: #8c8c8c;
    --accent: #4f46e5;
    --accent-2: #06b6d4;
    --muted: #6b7280;
    --bg-page: #f8fafc;
    --card-bg: #ffffff;
    --bg-main: #f7f7f7;
    --bg-card: #ffffff;
    --border-color: #e8e8e8;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    --border-radius-lg: 16px;
    --border-radius-md: 8px;
}

* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(120deg, #fff 0%, #f7f7f7 100%);
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
    color: #222;
    margin: 0;
    padding: 0;
}

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

/* --- LOGIN Y ELEMENTOS GLOBALES --- */
#login-section {
    background: var(--bg-card);
    padding: 3rem 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 550px;
    margin: 5rem auto;
}

#login-section h1 {
    font-size: 2.2rem;
    color: var(--strava-orange);
    margin-bottom: 0.5rem;
}

#login-section p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

button {
    background: #fc4c02;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.7em 1.5em;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s;
    margin: 0.2em 0.5em;
}

button:hover {
    background: #d84300;
}

.hidden {
    display: none !important;
}

/* --- LAYOUT DE LA APP --- */
#app-section header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

#app-section header h1 {
    margin: 0;
    font-size: 2.2rem;
    color: var(--text-dark);
}

#logout-button {
    background-color: var(--text-medium);
}

#logout-button:hover {
    background-color: var(--text-dark);
}

main {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- COMPONENTES --- */
.summary-grid,
.charts-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.full-width {
    grid-column: 1 / -1;
}

.card,
.chart-container {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 18px rgba(252, 76, 2, 0.08), 0 1.5px 4px rgba(0, 0, 0, 0.04);
    padding: 1.7rem 1.2rem 2.2rem 1.2rem;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    border-top: 4px solid #fc4c02;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    transition: box-shadow 0.2s;
}

.card h3 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
}

.card p {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
}

.chart-container:hover {
    box-shadow: 0 8px 32px rgba(252, 76, 2, 0.16), 0 2px 8px rgba(0, 0, 0, 0.07);
}

.chart-container h3 {
    margin-bottom: 1.2rem;
    font-size: 1.18rem;
    font-weight: 700;
    color: #fc4c02;
    letter-spacing: 0.02em;
    text-align: left;
}

.chart-container canvas {
    width: 100% !important;
    max-width: 100%;
    display: block;
    margin: 0 auto;
    background: #fff;
    border-radius: 10px;
    border: 1.5px solid #f5e7e0;
    box-shadow: none;
}

#cal-heatmap {
    margin-top: 1rem;
}

#activity-map {
    height: 340px;
    margin-bottom: 2rem;
    border-radius: 14px;
    overflow: hidden;
    min-width: 200px;
}

/* --- PANTALLA DE CARGA Y RESPONSIVE --- */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(247, 247, 247, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    border: 8px solid #e1e4e8;
    border-top: 8px solid var(--strava-orange);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

@media (max-width: 900px) {
    .charts-grid {
        grid-template-columns: 1fr;

        /* SVG chart container tweaks */
        .solo-group-svg {
            width: 100%;
        }

        .solo-svg {
            width: 100%;
            height: 48px;
            display: block;
        }

        .solo-svg text {
            font-family: Inter, 'Segoe UI', Roboto, Arial;
        }

        gap: 1.2rem;
    }
}

@media (max-width: 800px) {
    .charts-grid {
        max-width: 100vw;
        padding: 0 0.2rem;
    }

    .chart-container {
        padding: 1rem 0.2rem;
    }

    .chart-container canvas {
        height: 220px !important;
    }

    .activity-details-col {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
}

@media (max-width: 700px) {
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        padding: 0 0.2rem;
        max-width: 100vw;
    }

    .chart-container {
        padding: 1rem 0.2rem 1.5rem 0.2rem;
    }

    .chart-container canvas {
        height: 180px !important;
    }
}

/* style.css */

/* --- TABLAS Y LISTAS --- */
.df-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.95em;
    margin-top: 1rem;
}

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

.df-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--text-medium);
}

.df-table tr:nth-child(even) {
    background: #fdfdfd;
}


/* --- GEAR SECTION STYLES (VERSIÓN DEFINITIVA) --- */

#gear-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.edit-mode-toggle {
    width: 100%;
    text-align: right;
    margin-bottom: 1rem;
}

.gear-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow);
    padding: 1.2rem 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    border-top: 4px solid var(--text-light);
    /* Borde gris por defecto */
}

.gear-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.gear-card.primary {
    border-top-color: var(--strava-orange);
    /* Naranja si es primario */
}

.gear-card.retired {
    opacity: 0.7;
    background-color: #f8f9fa;
}

.gear-card.retired:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.badge {
    position: absolute;
    top: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    color: white;
}

.primary-badge {
    left: 12px;
    background-color: var(--strava-orange);
}

.retired-badge {
    right: 12px;
    background-color: var(--text-medium);
}

.gear-card h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.15em;
    color: var(--text-dark);
}

.gear-distance {
    /* Aplicado al <p> */
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--strava-orange);
    margin: 0;
    line-height: 1;
}

.durability-bar {
    width: 100%;
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin: 1rem 0 0.25rem 0;
}

.durability-progress {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease-out;
}

.gear-card small {
    color: var(--text-light);
    font-size: 0.85rem;
}

.gear-stats {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-medium);
}

.gear-stats span {
    flex: 1;
    text-align: center;
}

.gear-stats span:first-child {
    text-align: left;
}

.gear-stats span:last-child {
    text-align: right;
}


.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: var(--border-radius-md);
    padding: 0.75rem 1.25rem;
    margin-top: 1rem;
    width: 100%;
    text-align: center;
    font-weight: bold;
}

.gear-edit-fields {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
    width: 100%;
    font-size: 0.9rem;
}

.gear-edit-fields div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.gear-edit-fields input {
    width: 80px;
    padding: 5px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.gear-edit-fields button.save-gear-btn {
    width: 100%;
    margin-top: 0.5rem;
    background-color: #28a745;
}

.gear-edit-fields button.save-gear-btn:hover {
    background-color: #218838;
}

/* --- ESTILOS DE activity.html (que se habían perdido) --- */
.activity-details-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    /* Para que sea responsive */
}

.activity-details-col {
    flex: 1 1 300px;
    /* Crecerá y se encogerá, con una base de 300px */
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.activity-details-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    line-height: 1.6;
}

.activity-details-col h3 {
    margin-top: 0;
    color: var(--strava-orange);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

@media print {
    #export-buttons {
        display: none !important;
    }
}

/* --- Estilos para la calculadora VDOT incrustada --- */

.iframe-responsive-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    /* La altura original es 1600px, la mantenemos aquí */
    /* Puedes ajustar esta altura si lo ves necesario */
    height: 1600px;
    border: 1px solid #ddd;
    /* Un borde sutil para enmarcarlo */
    border-radius: 8px;
}

.iframe-responsive-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

#calculator-container p {
    margin-top: -1em;
    margin-bottom: 1.5em;
    font-size: 0.9em;
    color: #666;
}

/* --- Estilos para el Sistema de Pestañas --- */

.tab-nav {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 1.5em;
}

.tab-link {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 1.1em;
    font-weight: 500;
    color: #555;
    position: relative;
    top: 2px;
    /* Alinea el borde inferior con el de la barra */
    border-bottom: 2px solid transparent;
}

.tab-link:hover {
    background-color: #f4f4f4;
    color: #000;
}

.tab-link.active {
    color: #FC5200;
    /* Color naranja de Strava */
    border-bottom-color: #FC5200;
    font-weight: bold;
}

.tab-content {
    display: none;
    /* Oculta todas las pestañas por defecto */
}

.tab-content.active {
    display: block;
    /* Muestra solo la pestaña activa */
}

/* --- Estilos para la calculadora VDOT (los mismos que antes) --- */

.iframe-responsive-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 1600px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.iframe-responsive-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

#calculator-container p {
    margin-top: -1em;
    margin-bottom: 1.5em;
    font-size: 0.9em;
    color: #666;
}

/* --- Estilos para los Controles de Predicción --- */
.prediction-controls {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1em;
    margin-bottom: 1.5em;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
}

.prediction-controls fieldset {
    border: none;
    padding: 0;
    margin: 0;
    min-width: 200px;
}

.prediction-controls legend {
    font-weight: bold;
    margin-bottom: 0.5em;
    font-size: 1em;
    color: #333;
}

.prediction-controls .control-group {
    display: flex;
    gap: 1rem;
}

.prediction-controls .control-group.sliders {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.prediction-controls label {
    display: flex;
    align-items: center;
    gap: 0.3em;
    font-size: 0.9em;
}

.prediction-controls input[type="range"] {
    width: 100%;
}

/* Make inline SVG focusable visible for keyboard users */
.solo-svg:focus {
    outline: 3px solid rgba(3, 169, 244, 0.18);
    outline-offset: 3px;
}

/* Compact Solo vs Group: keep it tight in the header */
.solo-group-compare {
    font-size: 0.9rem;
}

.solo-group-compare .solo-group-svg {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.solo-group-compare .solo-svg {
    width: 160px;
    /* compact width */
    height: 22px;
    /* matches the SVG viewBox */
    display: block;
}

#update-predictions-btn {
    padding: 0.5em 1em;
    background-color: #FC5200;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-left: auto;
    /* Empuja el botón a la derecha */
}

#update-predictions-btn:hover {
    background-color: #d94700;
}

/* --- Estilos para las Nuevas Secciones de Datos en activity.html --- */
.data-section {
    margin-top: 2.5em;
    padding-top: 1.5em;
    border-top: 1px solid #eee;
}

.data-section h3 {
    margin-bottom: 0.25em;
    font-size: 1.5em;
    color: #333;
}

.data-section p {
    margin-top: 0;
    margin-bottom: 1em;
    font-size: 0.9em;
    color: #666;
}

.table-container {
    max-height: 400px;
    /* Limita la altura de las tablas largas */
    overflow-y: auto;
    /* Añade scroll vertical si es necesario */
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* --- Estilos para la Sección de Clasificación de Carrera --- */
#run-classifier-results {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}

.classifier-result {
    display: grid;
    grid-template-columns: 150px 1fr 60px;
    /* Tipo | Barra | Porcentaje */
    align-items: center;
    gap: 1em;
}

.classifier-type {
    font-weight: bold;
    font-size: 1.1em;
    text-align: right;
}

.classifier-bar-container {
    width: 100%;
    background-color: #e5e7eb;
    border-radius: 999px;
    height: 1.25em;
    overflow: hidden;
}

.classifier-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s ease-in-out;
}

.classifier-score {
    font-weight: bold;
    font-size: 1.1em;
}

/* =================================================================
   NUEVOS ESTILOS PARA LAYOUT FLEXIBLE (Side-by-Side)
   ================================================================= */

.side-by-side-container {
    display: flex;
    flex-wrap: wrap;
    /* Permite que los elementos se coloquen debajo en pantallas pequeñas */
    gap: 2rem;
    /* Espacio entre las columnas */
    align-items: stretch;
    /* Hace que ambas columnas tengan la misma altura */
    margin-top: 1.5em;
    margin-bottom: 2rem;
}

/* 
  Cada hijo directo del contenedor se convertirá en una columna flexible.
  flex: 1; -> Ocupará el espacio disponible.
  min-width: 300px; -> Ancho mínimo antes de que salte a la siguiente línea.
*/
.side-by-side-container>* {
    flex: 1;
    min-width: 300px;
}


/* Ajustes específicos para los contenedores dentro de la estructura flexible */

/* El contenedor del clasificador ya tiene la clase .data-section, que le da borde, etc. */
/* No necesita estilos adicionales. */


/* Ajustes para el contenedor del mapa */
#activity-map-container {
    display: flex;
    /* Lo convertimos en flex para que el mapa ocupe todo el alto */
    flex-direction: column;
}

#activity-map {
    width: 100%;
    flex-grow: 1;
    /* Hace que el mapa ocupe todo el espacio vertical disponible en su contenedor */
    min-height: 400px;
    /* Asegura una altura mínima para el mapa */
    border-radius: 8px;
    border: 1px solid var(--border-color);
}


/* Ajustes para los gráficos de splits, que también usan el side-by-side */
#splits-section .side-by-side-container {
    gap: 1rem;
    /* Un poco menos de espacio entre los gráficos */
}

#splits-section .chart-container {
    /* Los chart-container ya tienen estilos que funcionan bien como columnas flexibles */
    min-width: 250px;
    /* Ancho mínimo más pequeño para los gráficos */
}

/* --- Estilos para los Controles de Fecha y Año --- */

/* --- Estilos para los Controles de Fecha y Año (Versión Mejorada) --- */

.date-controls-container {
    display: flex;
    flex-wrap: wrap;
    /* Para que se ajuste en pantallas pequeñas */
    align-items: center;
    gap: 1rem 2rem;
    /* 1rem de espacio vertical, 2rem horizontal */
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: var(--border-radius-md);
    margin-bottom: 1.5em;
    border: 1px solid var(--border-color);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    /* Espacio entre los elementos DENTRO de un grupo */
}

/* Estilo para los botones de año */
.year-buttons button {
    background-color: #e9ecef;
    color: var(--text-medium);
    font-weight: 600;
    padding: 0.5em 1em;
}

.year-buttons button:hover {
    background-color: #ced4da;
    color: var(--text-dark);
}

/* Estilo para el botón de año activo */
.year-buttons button.active {
    background-color: var(--strava-orange);
    color: white;
}


/* --- Estilos para la sección de Perfil y Zonas --- */

.profile-and-zones-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

/* Estilos específicos para la tarjeta de perfil */
.profile-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.profile-content img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--strava-orange);
}

.profile-details {
    font-size: 0.9em;
    line-height: 1.6;
}

.profile-details span {
    display: block;
}

.profile-details .name {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--text-dark);
}

.profile-details .location {
    color: var(--text-medium);
}

.profile-details .stats {
    color: var(--text-light);
    font-style: italic;
}


/* Estilos específicos para la tarjeta de zonas */
.zones-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.zone-group {
    border-left: 3px solid var(--border-color);
    padding-left: 1rem;
}

.zone-group h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1em;
    color: var(--text-dark);
}

.zone-bar {
    display: flex;
    height: 20px;
    border-radius: 4px;
    overflow: hidden;
    font-size: 0.75em;
    font-weight: bold;
    color: white;
}

.zone-segment {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Colores para las zonas de Frecuencia Cardíaca (Z1 a Z5) */
.hr-z1 {
    background-color: #d1d5db;
    color: #374151;
}

.hr-z2 {
    background-color: #60a5fa;
}

.hr-z3 {
    background-color: #34d399;
}

.hr-z4 {
    background-color: #f59e0b;
}

.hr-z5 {
    background-color: #ef4444;
}


/* --- Ajustes para el nuevo layout en activity.html --- */

/* Asegura que el contenedor del gráfico de zonas se comporte como una columna flex */
#hr-zones-section {
    display: flex;
    flex-direction: column;
}

/* El contenedor interno del canvas debe crecer para ocupar el espacio */
.chart-container-inner {
    flex-grow: 1;
    position: relative;
    /* Necesario para que Chart.js mida el tamaño correctamente */
    width: 100%;
    height: 100%;
    min-height: 250px;
    /* Asegura una altura mínima para el gráfico */
}

/* El mapa ya no es una columna flexible, así que le damos un margen superior */
#activity-map-container {
    margin-top: 2rem;
}

#activity-map {
    height: 450px;
    /* Un poco más alto para que aproveche el ancho completo */
}

.disclaimer {
    font-size: 0.8em;
    color: #666;
    margin-top: 10px;
    line-height: 1.4;
}

/* Contenedor del gráfico */
.chart-container #hour-matrix {
    width: 100%;
    /* que ocupe todo el ancho del contenedor */
    max-width: 900px;
    /* opcional: limitar ancho máximo */
    height: 350px;
    /* altura fija */
    margin: auto;
    /* centrar horizontalmente */
}

/* Opcional: si quieres que todos los gráficos tengan un límite similar */
.chart-container canvas {
    max-height: 400px;
}

/* style.css */

.gear-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1em;
    margin-bottom: 1em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    background-color: #fff;
    position: relative;
}

.gear-card.retired {
    opacity: 0.7;
    background-color: #f8f9fa;
    border-left: 5px solid #6c757d;
}

.gear-card.primary {
    border: 2px solid #007bff;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.1);
}

.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #007bff;
    color: white;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    font-size: 0.75em;
}

.retired-badge {
    background-color: #6c757d;
}

.alert-critical {
    background-color: #dc3545;
    color: white;
    padding: 0.5em;
    margin-top: 0.8em;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
}

.alert-high {
    background-color: #ffc107;
    /* Amarillo */
    color: #343a40;
    /* Texto oscuro */
    padding: 0.5em;
    margin-top: 0.8em;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
}

.alert-medium {
    background-color: #fd7e14;
    /* Naranja */
    color: white;
    padding: 0.5em;
    margin-top: 0.8em;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
}

/* style.css (CONTINUACIÓN) */

.alert-low {
    background-color: #28a745;
    /* Verde */
    color: white;
    padding: 0.5em;
    margin-top: 0.8em;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
}

.durability-bar {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 5px;
    height: 10px;
    margin: 0.5em 0;
    overflow: hidden;
}

.durability-progress {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease-in-out;
}

.gear-stats {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 0.8em;
    font-size: 0.9em;
    color: #555;
}

.gear-stats span {
    flex-basis: 48%;
    /* Para dos columnas */
    margin-bottom: 0.5em;
}

.gear-edit-fields {
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px dashed #eee;
    display: flex;
    flex-direction: column;
    gap: 0.8em;
}

.gear-edit-fields div {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.gear-edit-fields label {
    font-weight: bold;
    flex-basis: 80px;
    /* Ancho fijo para las etiquetas */
}

.gear-edit-fields input[type="number"] {
    flex-grow: 1;
    padding: 0.4em;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.gear-edit-fields button {
    padding: 0.6em 1em;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    align-self: flex-end;
    /* Alinea el botón a la derecha */
}

.gear-edit-fields button:hover {
    background-color: #0056b3;
}

.edit-mode-toggle {
    text-align: right;
    margin-bottom: 1em;
}

.edit-mode-toggle button {
    background-color: #6c757d;
    color: white;
    padding: 0.5em 1em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.edit-mode-toggle button:hover {
    background-color: #5a6268;
}

/* Contenedor de las tarjetas de zapatillas para grid layout */
#gear-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5em;
}

/* Estilos para el gráfico de Gantt de equipo */
#gear-gantt-chart-container {
    margin-top: 2em;
}

/* Ajustes para Chart.js en general */
.chart-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 1.5em;
    margin-bottom: 1.5em;
}




.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.chart-container {
    background: #fff;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-container.wide {
    grid-column: span 2;
}

.weather-summary,
.monthly-stats,
.top-runs,
.runs-list {
    margin-top: 2rem;
    background: #fff;
    padding: 1.2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#corr-matrix table {
    width: 100%;
    border-collapse: collapse;
}

#corr-matrix td,
#corr-matrix th {
    padding: 8px;
    text-align: center;
    border: 1px solid #ccc;
}

#corr-matrix td {
    font-weight: bold;
    color: #222;
}

#monthly-table,
#runs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.8rem;
}

#monthly-table th,
#monthly-table td,
#runs-table th,
#runs-table td {
    border: 1px solid #ddd;
    padding: 6px 10px;
    text-align: center;
}

#monthly-table th,
#runs-table th {
    background: #f4f4f4;
}

#runs-table-container.hidden {
    display: none;
}

.top-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.top-section {
    flex: 1;
    min-width: 220px;
    background: #f9f9f9;
    border-radius: 10px;
    padding: 0.8rem;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.05);
}





.wa-stats-row {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.wa-card {
    flex: 1 1 150px;
    background: #f7f7f7;
    border-radius: 12px;
    padding: 10px 14px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease;
}

.wa-card:hover {
    transform: translateY(-2px);
}

.wa-card h4 {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 6px;
}

.wa-val {
    font-size: 1.3rem;
    font-weight: 600;
    color: #222;
}






@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: scaleX(0);
        transform-origin: left;
    }

    to {
        transform: scaleX(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

/* Year header */
.stats-year-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.stats-year-header h2 {
    font-size: 3rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

/* Professional theme refinements */
body {
    background: var(--bg-page);
    color: var(--text-dark);
    font-family: Inter, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.stat-card {
    background: var(--card-bg);
    border-top: none;
    padding: 1.1rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(16, 24, 40, 0.06);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    font-size: 1.4rem;
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.12);
}

.stat-value {
    font-size: 1.6rem;
    color: var(--text-dark);
    font-weight: 800;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: none;
}

.quick-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.quick-stat-item {
    background: var(--card-bg);
    border: 1px solid rgba(15, 23, 42, 0.03);
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

/* Solo vs Group: clean progress bars with fills */
.solo-group-compare {
    margin-top: 0.6rem;
}

.solo-group-compare .compare-bars {
    display: flex;
    gap: 0.8rem;
}

.solo-group-compare .compare-item {
    flex: 1;
    background: var(--card-bg);
    padding: 0.8rem;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.04);
}

.solo-group-compare .compare-name {
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 6px
}

.solo-group-compare .compare-bar {
    height: 18px;
    background: #eef2ff;
    border-radius: 999px;
    position: relative;
    overflow: hidden
}

.solo-group-compare .compare-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    border-radius: 999px;
}

.solo-group-compare .solo .compare-fill {
    background: linear-gradient(90deg, #1976d2, #03a9f4);
}

.solo-group-compare .group .compare-fill {
    background: linear-gradient(90deg, #10b981, #059669);
}

.solo-group-compare .compare-bar-label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35)
}

.solo-group-compare .compare-value {
    margin-top: 8px;
    text-align: right;
    color: var(--muted);
    font-weight: 600
}

/* Highlights polish */
.pb-category {
    padding: 1rem;
}

.pb-highlights {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    padding: 0.75rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.95));
    border-radius: 12px;
}

.pb-highlight {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 0.9rem;
    box-shadow: 0 6px 16px rgba(2, 6, 23, 0.04);
    min-width: 220px
}

.pb-highlight-label {
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 6px
}

.pb-activity-link {
    display: block;
    color: inherit;
    text-decoration: none
}

.pb-activity-link:hover {
    background: rgba(250, 250, 250, 0.9)
}

@media (max-width:900px) {
    .solo-group-compare .compare-bar-label {
        font-size: 0.78rem;
        left: 8px
    }
}

.stats-year-header p {
    color: #666;
    font-size: 1.1rem;
    margin: 0.5rem 0 0;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 10px 30px rgba(245, 87, 108, 0.3);
}

.stat-card:nth-child(2):hover {
    box-shadow: 0 15px 40px rgba(245, 87, 108, 0.4);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 10px 30px rgba(79, 172, 254, 0.3);
}

.stat-card:nth-child(3):hover {
    box-shadow: 0 15px 40px rgba(79, 172, 254, 0.4);
}

.stat-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    box-shadow: 0 10px 30px rgba(67, 233, 123, 0.3);
}

.stat-card:nth-child(4):hover {
    box-shadow: 0 15px 40px rgba(67, 233, 123, 0.4);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Quick stats */
.quick-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.quick-stat-item {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease;
}

.quick-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.quick-stat-label {
    color: #666;
    font-size: 0.9rem;
}

.quick-stat-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: #667eea;
}

/* Section headers */
.section-header {
    margin-bottom: 2rem;
}

.section-header h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-subtitle {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

/* Sport breakdown */
.sport-breakdown {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 3rem;
}

.sport-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.sport-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

.sport-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sport-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.sport-title {
    flex: 1;
}

.sport-title h4 {
    margin: 0 0 0.25rem;
    font-size: 1.3rem;
    color: #1a1a1a;
    font-weight: 600;
}

.sport-count {
    color: #666;
    font-size: 0.9rem;
}

.sport-share {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sport-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 900px) {
    .sport-breakdown {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .sport-breakdown {
        grid-template-columns: 1fr;
    }
}

.metric {
    text-align: center;
    padding: 0.6rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.15s ease;
    font-size: 0.88rem;
}

.metric:hover {
    background: #e9ecef;
}

.metric-label {
    font-size: 0.78rem;
    color: #666;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 0.98rem;
    font-weight: 700;
    color: #1a1a1a;
}

.metric-change {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.sport-progress {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 1rem;
}

.sport-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    animation: slideIn 1s ease-out;
}

/* Insights grid */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.insight-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: transform 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.insight-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.insight-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.insight-content {
    flex: 1;
}

.insight-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insight-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a1a;
}

.insight-detail {
    font-size: 0.9rem;
    color: #667eea;
    margin-top: 0.25rem;
    font-weight: 600;
}

/* Charts */
.chart-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1.5rem;
}

.chart-container {
    display: grid;
    gap: 0.75rem;
}

.chart-container-compact {
    gap: 0.5rem;
}

/* Make compact charts fit more rows so monthly bars don't overflow */
.chart-container-compact .chart-label {
    width: 90px;
    font-size: 0.85rem;
}

.chart-container-compact .chart-bar {
    height: 12px;
    border-radius: 6px;
}

.chart-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chart-label {
    width: 120px;
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

.chart-label-small {
    width: 60px;
}

.chart-bar-container {
    flex: 1;
    background: #f1f3f5;
    border-radius: 6px;
    overflow: hidden;
    height: 32px;
    position: relative;
}

.chart-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.75rem;
    transition: width 0.8s ease-out;
    animation: slideIn 1s ease-out;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.chart-bar-secondary {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.chart-bar-value {
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Hour chart */
.hour-chart {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 1rem 0;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f3f5;
}

.hour-chart::-webkit-scrollbar {
    height: 6px;
}

.hour-chart::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 3px;
}

.hour-chart::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.hour-bar {
    flex: 1;
    min-width: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hour-bar-fill {
    width: 100%;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px 4px 0 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
    transition: height 0.6s ease-out;
    position: relative;
    box-shadow: 0 -2px 8px rgba(102, 126, 234, 0.3);
}

.hour-bar-count {
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hour-label {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Efforts list */
.efforts-list {
    display: grid;
    gap: 1rem;
    margin-bottom: 3rem;
}

.effort-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 1rem;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.effort-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #ef4444;
}

.effort-rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ef4444;
    width: 50px;
    text-align: center;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.effort-content {
    flex: 1;
}

.effort-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.5rem;
}

.effort-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.effort-score-bar {
    height: 6px;
    background: #f1f3f5;
    border-radius: 3px;
    overflow: hidden;
}

.effort-score-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
    border-radius: 3px;
    animation: slideIn 1s ease-out;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.effort-score {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ef4444;
    width: 80px;
    text-align: right;
}

/* Personal bests */
.pb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.pb-category {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.pb-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.pb-category-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f3f5;
}

.pb-icon {
    font-size: 2rem;
}

.pb-category-header h4 {
    margin: 0;
    font-size: 1.2rem;
    color: #1a1a1a;
    font-weight: 600;
}

.pb-item {
    padding: 1rem 0;
    border-bottom: 1px solid #f1f3f5;
    transition: background 0.2s ease;
}

.pb-item:hover {
    background: #f8f9fa;
    margin: 0 -0.5rem;
    padding: 1rem 0.5rem;
    border-radius: 6px;
}

.pb-item:last-child {
    border-bottom: none;
}

.pb-distance {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.pb-time {
    font-size: 1.3rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.pb-attempts {
    font-size: 0.85rem;
    color: #666;
}

.pb-highlights {
    /* Make highlights sit side-by-side instead of spanning full grid */
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: stretch;
    background: linear-gradient(135deg, #fff5e6 0%, #ffe8cc 100%);
    border: 2px solid #ffd699;
    padding: 0.75rem;
}

.pb-highlight {
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    flex: 1 1 220px;
    /* allow them to shrink/grow and create columns */
    min-width: 220px;
}

.pb-highlight:last-child {
    margin-right: 0;
}

.pb-highlight-label {
    font-weight: 600;
    color: #d97706;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

/* Make the Highlights category span full width of the grid */
.pb-category.pb-highlights {
    grid-column: 1 / -1;
    width: 100%;
}

/* Solo vs Group comparison styles (more contrast and larger bars) */
.solo-group-compare {
    margin-top: 0.5rem;
}

.solo-group-compare .compare-bars {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.solo-group-compare .compare-item {
    flex: 1 1 0;
    background: #fff;
    padding: 0.75rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.solo-group-compare .compare-name {
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.solo-group-compare .compare-bar {
    height: 18px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-bottom: 0.5rem;
    background: #f1f5f9;
}

.solo-group-compare .compare-bar-label {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.solo-group-compare .compare-value {
    font-size: 0.95rem;
    color: #444;
    text-align: right;
    font-weight: 600;
}

/* Styles for pb activity links inside highlights */
.pb-activity-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.pb-activity-link:hover {
    text-decoration: none;
    background: rgba(246, 246, 246, 0.9);
}

.pb-activity strong {
    color: #1a1a1a;
}

.pb-details {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.pb-date {
    color: #999;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Extras grid */
.extras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.extra-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.gear-list,
.country-list {
    display: grid;
    gap: 1rem;
}

.gear-item,
.country-item {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.gear-item:hover,
.country-item:hover {
    background: #f8f9fa;
}

.gear-name,
.country-name {
    font-weight: 500;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gear-bar-container,
.country-bar-container {
    height: 8px;
    background: #f1f3f5;
    border-radius: 4px;
    overflow: hidden;
}

.gear-bar,
.country-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 4px;
    animation: slideIn 0.8s ease-out;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.gear-hours,
.country-count {
    font-weight: 600;
    color: #10b981;
    text-align: right;
}

/* Activities table */
.activities-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.activities-table {
    width: 100%;
    border-collapse: collapse;
}

.activities-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.activities-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.activities-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f3f5;
}

.activities-table tbody tr {
    transition: background-color 0.2s ease;
}

.activities-table tbody tr:hover {
    background-color: #f8f9fa;
}

.table-date {
    color: #666;
    font-size: 0.9rem;
    white-space: nowrap;
}

.table-name {
    font-weight: 500;
    color: #1a1a1a;
}

.type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-radius: 12px;
    font-size: 0.85rem;
    color: #495057;
    font-weight: 500;
    transition: transform 0.2s ease;
}

.type-badge:hover {
    transform: scale(1.05);
}



#wrapped-map {
    width: 100%;
    height: 400px;
    /* o lo que quieras */
}







/* En tu archivo CSS */
.card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.card h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.chart-container {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
    margin-bottom: 1rem;
    color: #333;
}

.metric-row:hover {
    background: #f9f9f9;
}

.activity-item:hover {
    background: #f9f9f9;
}




.range-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #f7f7f7;
    cursor: pointer;
    color: #0b0b0b;
}

.range-btn.active {
    background: #007bff;
    color: #0b0b0b;
    border-color: #007bff;
}





/* ============================================================================
   GEAR TAB - MODERN STYLES
   ============================================================================ */

/* Header Section */
.gear-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.gear-header h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

/* Edit Toggle Button */
.edit-toggle-btn {
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.edit-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Grid Layout */
.gear-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .gear-grid {
        grid-template-columns: 1fr;
    }
}

/* Gear Card */
.gear-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.gear-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
}

.gear-card.retired {
    opacity: 0.7;
    border-color: #9ca3af;
}

.gear-card.needs-replacement {
    border-color: #ef4444;
    background: linear-gradient(to bottom, #fff 0%, #fef2f2 100%);
}

/* Status Badges */
.status-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.retired {
    background: #e5e7eb;
    color: #6b7280;
}

.status-badge.primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.status-badge.alert {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Card Header */
.gear-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.gear-icon {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.gear-title h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.gear-category {
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* Distance Display */
.gear-distance-display {
    text-align: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 12px;
}

.distance-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #111827;
    line-height: 1;
}

.distance-unit {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 600;
    margin-left: 0.25rem;
}

/* Durability Section */
.durability-section {
    margin: 1.5rem 0;
}

.durability-bar {
    height: 12px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.durability-fill {
    height: 100%;
    border-radius: 999px;
    transition: all 0.6s ease;
    position: relative;
    overflow: hidden;
}

.durability-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.durability-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    font-weight: 500;
}

/* Stats Section */
.gear-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.stat-item {
    background: #f9fafb;
    padding: 0.75rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1rem;
    color: #111827;
    font-weight: 700;
}

/* Replacement Alert */
.replacement-alert {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    padding: 0.875rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    margin-top: 1rem;
    border: 1px solid #fca5a5;
    animation: alertPulse 2s infinite;
}

@keyframes alertPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

/* Edit Section */
.gear-edit-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px dashed #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.edit-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.edit-input-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.edit-input-group input {
    padding: 0.625rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.edit-input-group input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.save-gear-btn {
    padding: 0.75rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.save-gear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.save-gear-btn.saved {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

/* State Messages */
.empty-state,
.error-state,
.loading-state {
    text-align: center;
    padding: 3rem 2rem;
    font-size: 1.125rem;
    color: #6b7280;
}

.empty-state {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 16px;
    border: 2px dashed #d1d5db;
}

.error-state {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-radius: 16px;
    border: 2px solid #fca5a5;
}

.loading-state {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-radius: 16px;
    animation: loadingPulse 1.5s infinite;
}

@keyframes loadingPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Notification System */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.notification-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.notification-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

/* Responsive Design */
@media (max-width: 640px) {
    .gear-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .gear-distance-display {
        padding: 0.75rem;
    }

    .distance-value {
        font-size: 2rem;
    }

    .gear-icon {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }

    .notification {
        right: 1rem;
        left: 1rem;
        top: 1rem;
    }
}



/* wrapped */
/* General Layout & Responsiveness */
.stats-grid,
.sport-breakdown,
.pb-grid,
.extras-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.sport-breakdown {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.pb-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.extras-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

@media (max-width: 768px) {

    .stats-grid,
    .sport-breakdown,
    .pb-grid,
    .extras-grid {
        grid-template-columns: 1fr;
    }
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.section-header h3 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 0.95rem;
    color: #666;
}

/* --- Summary Cards --- */
.stat-card {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 0.4rem;
}

.stat-label {
    font-size: 0.95rem;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 3rem;
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.quick-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.quick-stat-label {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 0.3rem;
}

.quick-stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #444;
}

/* --- Sport Breakdown --- */
.sport-card {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sport-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.sport-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.sport-icon {
    font-size: 2rem;
    margin-right: 1rem;
    width: 40px;
    text-align: center;
}

.sport-title {
    flex-grow: 1;
}

.sport-title h4 {
    margin: 0;
    font-size: 1.3rem;
    color: #333;
}

.sport-count {
    font-size: 0.85rem;
    color: #777;
}

.sport-share {
    font-size: 1.2rem;
    font-weight: 600;
    color: #007bff;
    /* Example accent color */
}

.sport-metrics {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.metric {
    text-align: center;
}

.metric-label {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.2rem;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.metric-change {
    font-size: 0.85rem;
    font-weight: 500;
}

.sport-progress {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.sport-progress-bar {
    height: 100%;
    background-color: #007bff;
    /* Example accent color */
    border-radius: 4px;
}

/* --- Activity Patterns (Histograms) --- */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.insight-card {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
}

.insight-icon {
    font-size: 2rem;
    margin-right: 1rem;
}

.insight-label {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.2rem;
}

.insight-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

.insight-detail {
    font-size: 0.8rem;
    color: #666;
}

/* Temporal Charts Combined */
.temporal-charts-combined {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* Adjust minmax as needed */
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.chart-section {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.chart-title-sm {
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 1rem;
    text-align: center;
    border-bottom: 1px dashed #eee;
    padding-bottom: 0.5rem;
}

.chart-container-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 250px;
    /* Limit height for monthly/weekly bars */
    overflow-y: auto;
    /* Scroll if too many months/days */
    padding-right: 5px;
    /* Space for scrollbar */
}

.chart-row {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
}

.chart-label-sm {
    width: 60px;
    /* Adjust width for labels */
    flex-shrink: 0;
    color: #555;
    text-align: right;
    padding-right: 5px;
}

.chart-bar-container-sm {
    flex-grow: 1;
    height: 12px;
    background-color: #e9ecef;
    border-radius: 6px;
    margin: 0 8px;
    position: relative;
}

.chart-bar {
    height: 100%;
    background-color: #007bff;
    border-radius: 6px;
    transition: width 0.5s ease-out;
}

.chart-bar-secondary {
    background-color: #28a745;
    /* Green for weekly */
}

.chart-value-sm {
    width: 50px;
    /* Adjust width for values */
    flex-shrink: 0;
    color: #333;
    font-weight: 500;
    text-align: left;
}


/* Hour Chart Compact */
.hour-chart-compact {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    /* Bars start from bottom */
    height: 120px;
    /* Fixed height for the hour chart */
    margin-top: 1rem;
    padding: 0 5px;
    overflow-x: auto;
    /* Allow scrolling for many hours */
}

.hour-bar-compact {
    flex-shrink: 0;
    width: 15px;
    /* Fixed width for each hour bar */
    margin: 0 1px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
}

.hour-bar-fill-compact {
    width: 100%;
    background-color: #fd7e14;
    /* Orange for hourly */
    border-radius: 3px 3px 0 0;
    transition: height 0.5s ease-out;
}

.hour-label-compact {
    font-size: 0.7rem;
    color: #777;
    margin-top: 5px;
    transform: rotate(-45deg);
    /* Rotate labels for compactness */
    white-space: nowrap;
    position: absolute;
    bottom: -20px;
    /* Adjust as needed */
}

/* --- Hardest Workouts (compact version) --- */
.efforts-list-compact {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    /* Smaller gap */
}

.effort-card-compact {
    background-color: #fff;
    padding: 0.8rem 1.2rem;
    /* Reduced padding */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.effort-card-compact:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Compact preview + toggle helpers for Hardest Workouts */
.efforts-preview {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.efforts-full {
    margin-top: 0.6rem;
    max-height: 420px;
    overflow: auto;
    padding-right: 6px;
}

.btn-small {
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff;
    border: none;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.12);
}

.btn-small:hover {
    transform: translateY(-1px);
}

.effort-rank {
    font-size: 1.1rem;
    font-weight: 700;
    color: #007bff;
    margin-right: 1rem;
    min-width: 30px;
    text-align: center;
}

.effort-content-compact {
    flex-grow: 1;
}

.effort-title-compact {
    margin: 0;
    font-size: 1rem;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.effort-meta-compact {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.4rem;
}

.effort-score-bar-compact {
    height: 6px;
    /* Smaller bar */
    background-color: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.effort-score-fill-compact {
    height: 100%;
    background-color: #dc3545;
    /* Red accent */
    border-radius: 3px;
    transition: width 0.4s ease-out;
}

.effort-score-compact {
    font-size: 1.1rem;
    font-weight: 600;
    color: #dc3545;
    margin-left: 1rem;
    min-width: 40px;
    text-align: right;
}

/* --- Personal Bests --- */
.pb-category {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.pb-category-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px dashed #eee;
}

.pb-icon {
    font-size: 1.8rem;
    margin-right: 0.8rem;
}

.pb-category-header h4 {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
}

.pb-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px dotted #f0f0f0;
}

.pb-item:last-child {
    border-bottom: none;
}

.pb-distance {
    font-weight: 600;
    color: #444;
    flex-grow: 1;
}

.pb-time {
    font-size: 0.95rem;
    color: #555;
    margin-left: 1rem;
}

.pb-attempts {
    font-size: 0.8rem;
    color: #888;
    margin-left: 0.5rem;
}

.pb-highlights .pb-highlight {
    padding: 0.6rem;
    border-bottom: none;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    flex: 1 1 220px;
    min-width: 220px;
}

.pb-highlights .pb-highlight:last-child {
    margin-right: 0;
}

.pb-highlight-label {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.3rem;
}

.pb-activity strong {
    font-size: 1rem;
    color: #333;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pb-details,
.pb-date {
    font-size: 0.75rem;
    color: #777;
}

/* --- Gear & Countries (Extras) --- */
.extra-section {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.gear-list,
.country-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.gear-item,
.country-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    padding: 0.3rem 0;
}

.gear-name,
.country-name {
    flex-basis: 100px;
    /* Fixed width for names */
    flex-shrink: 0;
    color: #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gear-bar-container,
.country-bar-container {
    flex-grow: 1;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    margin: 0 10px;
    overflow: hidden;
}

.gear-bar {
    height: 100%;
    background-color: #ffc107;
    /* Yellow accent */
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

.gear-hours,
.country-count {
    width: 50px;
    /* Fixed width for values */
    text-align: right;
    font-weight: 500;
    color: #555;
}

.country-bar {
    height: 100%;
    background-color: #17a2b8;
    /* Cyan accent */
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

/* --- Global Heatmap --- */
#wrapped-heatmap {
    height: 500px;
    /* Ensure map has a height */
    width: 100%;
    margin-top: 2rem;
    margin-bottom: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    /* Important for map corners */
    position: relative;
    /* For header positioning */
}

#wrapped-heatmap .leaflet-pane {
    z-index: 10;
    /* Ensure map content is above other page elements if needed */
}

.heatmap-header {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    /* Ensure header is above the map */
    background: rgba(255, 255, 255, 0.85);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    width: auto;
    /* Adjust width based on content */
    border-bottom: none;
    /* Remove border-bottom from general header */
}

.heatmap-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #333;
}

.heatmap-header .section-subtitle {
    margin-top: 0.3rem;
    font-size: 0.85rem;
    color: #666;
}

/* --- Activities Table --- */
.activities-table-container {
    overflow-x: auto;
    margin-top: 2rem;
    margin-bottom: 3rem;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.activities-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
    /* Ensure table doesn't get too cramped */
}

.activities-table th,
.activities-table td {
    padding: 1rem 1.2rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.activities-table th {
    background-color: #f8f9fa;
    color: #555;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 2;
    /* Keep header visible on scroll */
}

.activities-table tbody tr:last-child td {
    border-bottom: none;
}

.activities-table tbody tr:hover {
    background-color: #f4f7fa;
}

.table-date {
    font-size: 0.9rem;
    color: #777;
}

.table-name {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
    /* Limit width */
}

.type-badge {
    background-color: #e0f2f7;
    /* Light blue */
    color: #007bff;
    padding: 0.3em 0.7em;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
}

.table-distance,
.table-time {
    color: #555;
    font-size: 0.9rem;
}

.table-pace {
    font-style: italic;
    color: #666;
    font-size: 0.9rem;
}

.table-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.table-link:hover {
    color: #0056b3;
}

/* Utility classes for animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease-out forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: #777;
    font-style: italic;
    background-color: #f8f8f8;
    border-radius: 8px;
    margin-bottom: 2rem;
}

/* ------------------------------------------------------------------
   Overrides & modern tweaks (final layer)
   Ensures stat values fit inside cards and modern Solo vs Group look
------------------------------------------------------------------ */

/* Force stat values to be compact and wrap where needed */
.stats-grid .stat-card .stat-value,
.stat-card .stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.05;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Ensure monthly/compact charts show all rows without overflow */
.chart-container-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: none;
}

.chart-container-compact .chart-row {
    padding: 0.28rem 0;
}

.chart-container-compact .chart-label {
    width: 78px;
    font-size: 0.78rem;
}

.chart-container-compact .chart-bar {
    height: 9px;
}

/* Modern Solo vs Group widget (final polish) */
.solo-compare-card {
    display: block;
    width: 100%;
    background: linear-gradient(180deg, #ffffff 0%, #fbfbff 100%);
    border-radius: 12px;
    padding: 0.85rem;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.04);
}

.mini-bar {
    background: #f1f5f9;
    height: 9px;
    border-radius: 999px;
    overflow: hidden;
}

.mini-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s ease;
}

.mini-bar-fill.solo {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.mini-bar-fill.group {
    background: linear-gradient(90deg, #06b6d4 0%, #00b894 100%);
}

@media (max-width: 700px) {
    .stats-grid .stat-card .stat-value {
        font-size: 1rem;
    }

    .chart-container-compact .chart-label {
        width: 60px;
        font-size: 0.72rem;
    }
}

/* ------------------------------------------------------------------
   Unified card styling for a consistent, professional look
------------------------------------------------------------------ */
.stat-card,
.sport-card,
.pb-category,
.effort-card,
.effort-card-compact,
.extra-section,
.chart-container {
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.04);
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.04);
}

/* Make stat icons purely decorative (no emoji) and consistent */
.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff;
    box-shadow: 0 6px 14px rgba(79, 70, 229, 0.08);
}

/* Sport breakdown responsive: 3 cols desktop, 2 tablet, 1 mobile */
.sport-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 1000px) {
    .sport-breakdown {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .sport-breakdown {
        grid-template-columns: 1fr;
    }
}

/* Slight padding/tone unification for sport-card header */
.sport-card-header {
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}