/**
 * Estilos para el módulo de Cruz de Seguridad
 * @author Sistema Médico
 * @date 2025-12-23
 */

/* ========== Contenedor Principal ========== */
.cruz-seguridad-container {
    padding: 20px 0;
}

.cruz-header {
    background: linear-gradient(135deg, #1DA3B2 0%, #158995 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.cruz-header h1 {
    font-size: 32px;
    font-weight: bold;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.cruz-header p {
    font-size: 16px;
    margin: 0;
    opacity: 0.9;
}

.cruz-header-subtitle,
.cruz-header-period {
    color: #e5e0e0 !important;
}

/* ========== Info-boxes de estadísticas ========== */
.cruz-info-text {
    text-align: center;
}

.cruz-info-number {
    text-align: center;
    margin-top: 10px;
    font-size: x-large;
}

/* ========== Títulos y encabezados ========== */
.cruz-calendar-title {
    margin-bottom: 20px;
}

.cruz-incident-title {
    margin-bottom: 20px;
}

.cruz-incident-panel {
    display: none;
}

/* ========== Elementos auxiliares ========== */
.cruz-hidden {
    display: none;
}

.cruz-logo-container {
    padding: 50px 0;
}

.cruz-logo {
    max-width: 80%;
    height: auto;
}

/* ========== Selector de Mes/Año ========== */
.month-selector {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    /* background: white;*/
    background-color: #f6f6f6;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.month-selector .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 180px;
}

.month-selector label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: block;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.month-selector label i {
    margin-right: 6px;
    color: #667eea;
}

.month-selector .form-control {
    padding: 10px 15px;
    font-size: 14px;
    border: 2px solid #e1e4e8;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 150px;
    background-color: #fafbfc;
    font-weight: 500;
}

.month-selector .form-control:hover {
    border-color: #c1c9d2;
    background-color: #fff;
}

.month-selector .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: #fff;
    outline: none;
}

/* Estilos especiales para el selector de cliente */
.month-selector .form-group:first-child .form-control {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    font-weight: 600;
}

.month-selector .form-group:first-child label {
    color: #667eea;
}

.month-selector .btn {
    padding: 10px 35px;
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(135deg, #66c5ea 0%, #4b98a2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 24px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.month-selector .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.month-selector .btn:active {
    transform: translateY(0);
}

/* ========== Calendario en forma de Cruz ========== */
.calendar-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 30px;
}

.calendar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    width: 100%;
    max-width: 450px;
}

.calendar-row {
    display: flex;
    justify-content: center;
    margin: 3px 0;
}

.calendar-cell {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #333;
    margin: 3px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    position: relative;
}

.calendar-cell:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.calendar-cell.today {
    border: 3px solid #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    animation: pulse 2s infinite;
    font-size: 18px;
}

.calendar-cell.empty {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    cursor: default;
    box-shadow: none;
}

.calendar-cell.empty:hover {
    transform: none;
    box-shadow: none;
}

/* Animación para el día actual */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 1);
    }
}

/* ========== Estadísticas Info-Boxes ========== */
.cruz-stats-container {
    margin-bottom: 30px;
}

.info-box {
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.info-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.info-box-icon {
    border-radius: 10px 0 0 10px;
}

.info-box.bg-black {
    background-color: #000 !important;
    color: #fff !important;
}

.info-box.bg-purple {
    background-color: #605ca8 !important;
    color: #fff !important;
}

/* ========== Leyenda de Colores ========== */
.legend-container {
    margin-bottom: 30px;
}

.legend-item {
    padding: 20px;
    border-radius: 10px;
    margin: 10px 5px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.legend-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.legend-item i {
    display: block;
    margin-bottom: 10px;
}

.legend-item p {
    margin: 10px 0 5px 0;
    font-weight: bold;
    font-size: 16px;
}

.legend-item small {
    font-size: 13px;
    opacity: 0.9;
}

.legend-item.legend-safe {
    background-color: #00a65a;
    color: white;
}

.legend-item.legend-incident {
    background-color: #f39c12;
    color: #333;
}

.legend-item.legend-accident {
    background-color: #dd4b39;
    color: white;
}

.legend-item.legend-fatality {
    background-color: #000;
    color: white;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .month-selector {
        flex-direction: column;
        gap: 10px;
    }
    
    .month-selector .btn {
        margin-top: 10px;
        width: 100%;
    }
    
    .calendar-cell {
        width: 40px;
        height: 40px;
        font-size: 14px;
        margin: 2px;
    }
    
    .cruz-header h1 {
        font-size: 24px;
    }
    
    .legend-item {
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    .calendar-cell {
        width: 35px;
        height: 35px;
        font-size: 12px;
        margin: 1px;
    }
    
    .month-selector .form-control {
        min-width: 120px;
    }
}

/* ========== Tooltip para celdas del calendario ========== */
.calendar-cell[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.calendar-cell[data-tooltip]:after {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.calendar-cell[data-tooltip]:hover:before,
.calendar-cell[data-tooltip]:hover:after {
    opacity: 1;
}

/* ========== Mejoras adicionales ========== */
.box {
    border-radius: 10px;
    overflow: hidden;
}

.box-header {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    border-bottom: 2px solid #ddd;
}

.box-title {
    font-weight: bold;
    color: #333;
}

/* ========== Animaciones ========== */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(129, 199, 132, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(129, 199, 132, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(129, 199, 132, 0);
    }
}

.pulse-animation {
    animation: pulse 0.6s ease-in-out;
}

/* Cursor pointer para celdas clickeables */
.clickable-day {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.clickable-day:hover {
    transform: scale(1.1);
    z-index: 10;
}

/* Estilo para el día seleccionado */
.clickable-day.selected {
    box-shadow: 0 0 0 4px #FFD700, 0 0 20px rgba(255, 215, 0, 0.6);
    transform: scale(1.15);
    z-index: 100;
    position: relative;
}

.clickable-day.selected::after {
    content: '';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #FFD700;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
