/* ================================================================== */
/* 1. CONTROLES DEL CALENDARIO                                        */
/* ================================================================== */
#main-title {
    color: Teal;
}

#calendar-controls {
    display: flex;
    flex-wrap: wrap; /* Permite que los botones bajen si no caben */
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem; /* Espacio entre grupos */
}

/* En pantallas pequeñas (móviles) */
@media (max-width: 576px) {
    #calendar-controls {
        flex-direction: column; /* Apila los controles */
        justify-content: center; /* Centra los controles apilados */
        gap: 0.75rem; /* Aumenta el espacio vertical */
    }
    #calendar-controls .btn-group {
        width: 100%;
    }
    #calendar-controls .btn-group .btn {
        flex-grow: 1;
    }
    #today-btn {
        width: 100%;
        margin-left: 0 !important;
    }
}

/* ================================================================== */
/* 2. CARRUSEL DE DÍAS (CORREGIDO VISTA SEMANAL)                      */
/* ================================================================== */

/* El "wrapper" o ventana */
#day-carousel-wrapper {
    overflow-x: hidden; /* No queremos scroll, queremos que quepan */
}

/* El "tira" de días */
#day-carousel {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between; /* Reparte los 7 días */
    gap: 1px; /* <-- GAP PEQUEÑO ENTRE DÍAS */
    width: 100%;
}

/* === VISTA SEMANAL (.day-card) === */
.day-card {
    cursor: pointer;
    background-color: #ffffff;
    color: #343a40;
    border: 2px solid #9ec5fe; /* Borde azul */

    /* Flex properties para que sean iguales */
    min-width: 0 !important;
    flex-basis: 0 !important;
    flex-grow: 1 !important;
    flex-shrink: 1 !important;

    transition: all 0.2s;
    position: relative;
    border-radius: .375rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
    /* --- ★ CAMBIO: ALTURA REDUCIDA PARA QUE SEA MÁS CUADRADO ★ --- */
    height: 85px !important; /* Antes 70px */
    padding: 2px 0px !important; /* Padding mínimo */
    overflow: hidden;
}
/* ================================================================== */


/* ================================================================== */
/* 3. ESTRUCTURA INTERNA (ANILLO + TEXTO) (CORREGIDO)                 */
/* ================================================================== */

/* Contenedor que define el tamaño del círculo */
.progress-ring-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* --- ★ CAMBIO: TAMAÑO DEL CÍRCULO REDUCIDO ★ --- */
    width: 70px;  /* Antes 50px */
    height: 70px; /* Antes 50px */
}

/* El texto (DL, 17) se posiciona en el centro */
.day-info {
    position: relative;
    z-index: 1;
    text-align: center;
    line-height: 1;
}
.day-name {
    font-size: 0.6rem !important; /* Texto un poco más pequeño */
    margin-bottom: 1px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
}
.day-number {
    font-size: 0.95rem !important; /* Número ajustado */
    font-weight: 700;
    line-height: 1;
    color: #212529;
}
/* ================================================================== */


/* === VISTA MENSUAL (.day-cell) === */
.month-calendar { table-layout: fixed; }
.month-calendar .day-cell {
    cursor: pointer; position: relative;
    height: 60px; padding: 2px !important;
}
.month-calendar .day-cell > div {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    height: 100%; width: 100%; position: relative;
}
.month-calendar .day-cell:hover:not(.is-empty) { background-color: #f0faff; }
.month-calendar .day-cell.active { background-color: var(--custom-primary-teal); color: white; font-weight: bold; border-radius: 0.25rem; }
.month-calendar .day-cell.today { box-shadow: 0 0 0 2px var(--custom-brand-purple) inset; border-radius: 0.25rem; }
.month-calendar .day-cell .day-number-month { font-size: 1rem; position: relative; z-index: 1; }


/* === ESTILOS PARA ANILLO DE PROGRESO (SVG) === */
.progress-ring {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}
.progress-ring__background, .progress-ring__circle {
    fill: none;
}
.progress-ring__background { stroke: #e9ecef; }
.progress-ring__circle {
    stroke: #ffc107; stroke-linecap: round; transform-origin: 50% 50%;
    transform: rotate(-90deg); transition: stroke-dashoffset 0.3s;
}
.progress-ring__circle--complete { stroke: #48c58e; } /* Verde suave */

/* Tamaño y grosor VISTA SEMANAL */
.day-card .progress-ring {
    width: 100%; /* Ocupa el 100% del container (42px) */
    height: 100%;
}
/* --- ★ CAMBIO: GROSOR DEL ANILLO REDUCIDO ★ --- */
.day-card .progress-ring__background, .day-card .progress-ring__circle {
    stroke-width: 5 !important; /* Antes 8. Ahora es más fino */
}

/* Tamaño y grosor VISTA MENSUAL (Sin cambios) */
.month-calendar .day-cell .progress-ring { width: 40px; height: 40px; }
.month-calendar .day-cell .progress-ring__background, .month-calendar .day-cell .progress-ring__circle { stroke-width: 3.5; }

/* Estado activo (Día seleccionado) */
.day-card.active {
    background-color: #cfe2ff;
    color: #0a58ca;
    border-color: #a6cbfd;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, .15);
}
.day-card.active .day-name { color: #0a58ca; }
.day-card.active .day-number { color: #0a58ca; }
.day-card.active .progress-ring__background { stroke: rgba(108, 117, 125, 0.2); } 
.day-card.active .progress-ring__circle { stroke: #ffc107; } 
.day-card.active .progress-ring__circle--complete { stroke: #48c58e; } 

.month-calendar .day-cell.active .progress-ring__background { stroke: rgba(255, 255, 255, 0.3); }
.month-calendar .day-cell.active .progress-ring__circle { stroke: white; }
.month-calendar .day-cell.active .progress-ring__circle--complete { stroke: white; }


/* === ESTILOS PARA DÍAS VACÍOS === */
.month-calendar .day-cell.is-empty, .day-card.is-empty {
    cursor: default;
}
.month-calendar .day-cell.is-empty {
    background-color: #f8f9fa; color: #adb5bd;
}
.day-card.is-empty {
    background-color: #f8f9fa; color: #adb5bd; opacity: 0.6;
    border: 1px solid #dee2e6;
}
.day-card.is-empty:hover { background-color: #f8f9fa; }

/* Selector */
#treatment-selector-container { max-width: 400px; }

/* Estrellas feedback */
.star-rating { font-size: 2rem; color: #d3d3d3; cursor: pointer; }
.star-rating .bi-star-fill { color: #ffc107; }

.view-toggle-btn {
    background-color: Teal !important;
    border-color: #9ec5fe !important;
    color: White!important;
}
.view-toggle-btn:hover {
     background-color: #a6d8ff !important;
     border-color: #8bbde9 !important;
     color: #0a58ca !important;
}

/* === Estilos Modal Ejercicio === */
#exercise-media-container {
    max-height: 55vh;
    overflow: hidden;
}
#exercise-media-container .modal-video,
#exercise-media-container .modal-image {
    max-height: 55vh;
    max-width: 100%;
}
.no-media-placeholder-modal {
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.2rem;
}
.no-media-placeholder-modal i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Clases para deshabilitar menús */
.menu-disabled {
    pointer-events: none;
    opacity: 0.5;
}

/* --- Estils per al contenidor d'anuncis --- */
#dashboard-announcements {
    max-height: 200px;
    overflow-y: auto;
}

/* ================================================================== */
/* 4. ESTILOS ESPECÍFICOS PARA MÓVIL (Vista Semanal - FINAL/CORREGIDO)*/
/* ================================================================== */
@media (max-width: 767.98px) {
    
    /* Ajuste del contenedor del carrusel para que no haya scroll horizontal */
    #day-carousel {
        gap: 2px !important; 
        padding: 0 1px;
    }

    /* 1. TARJETA MÁS ALTA Y REORGANIZADA */
    .day-card {
        height: auto !important;
        min-height: 80px !important; 
        border-radius: 10px !important;
        border: 1px solid #dee2e6;
        padding: 6px 1px !important; /* AJUSTE: Más padding superior/inferior para el "aire" */
        margin: 0 !important;
        display: flex; 
        flex-direction: column;
        justify-content: flex-start; 
        align-items: center;
    }

    /* Estado ACTIVO (La píldora azul seleccionada) */
    .day-card.active {
        background-color: #e7f1ff !important;
        border-color: #0d6efd !important;
        box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
    }

    /* 2. ETIQUETA DEL DÍA (DL, DM) - FUERA DEL CÍRCULO */
    .day-name-top {
        font-size: 0.55rem !important; 
        margin-bottom: 8px; 
        color: #6c757d;
        font-weight: 600;
        line-height: 1;
        text-transform: uppercase;
    }

    /* 3. CONTENEDOR DEL ANILLO Y NÚMERO (AJUSTADO PARA QUE NO SE CORTE) */
    .progress-ring-container {
        width: 38px !important; /* AJUSTE CLAVE: Aumentado de 40px a 42px */
        height: 38px !important; /* AJUSTE CLAVE: Aumentado de 40px a 42px */
        margin-bottom: 0px !important;
        padding: 1px; /* Añade un pequeño margen interno para el anillo */
    }

    /* 4. NÚMERO (DENTRO DEL CÍRCULO) */
    .day-number-inner {
        position: relative; 
        z-index: 1;
        text-align: center;
    }
    .day-number {
        font-size: 0.75rem !important; 
        font-weight: 700;
        line-height: 1;
    }

    /* Estilos para estado activo */
    .day-card.active .day-name-top {
        color: #0d6efd !important;
    }
    .day-card.active .day-number {
        color: #0d6efd !important;
    }
}