/**
 * SIRYC - Estilos del Calendario de Mantenimientos
 * Diseño tipo agenda semanal profesional
 */

/* ===== CONTENEDOR PRINCIPAL ===== */
.calendario-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: calc(100vh - var(--navbar-height) - 100px);
    min-height: 600px;
}

/* ===== HEADER DEL CALENDARIO ===== */
.calendario-header {
    background: var(--bg-white);
    padding: 1rem 1.25rem;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.semana-navegacion {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-nav {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s;
    background: var(--bg-light);
}

.btn-nav:hover {
    background: var(--siryc-primary);
    color: #fff;
}

.semana-actual {
    min-width: 200px;
    text-align: center;
}

.semana-rango {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-dark);
}

/* ===== BARRA DE ESTADÍSTICAS ===== */
.stats-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.875rem 1.25rem;
    background: var(--bg-white);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow-x: auto;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: fit-content;
}

.stat-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 0.25rem;
}

.stat-divider {
    width: 1px;
    height: 30px;
    background: var(--border-color);
}

.stat-item.stat-success .stat-number { color: #28a745; }
.stat-item.stat-warning .stat-number { color: var(--macrogram-orange); }
.stat-item.stat-info .stat-number { color: var(--siryc-primary); }
.stat-item.stat-danger .stat-number { color: #dc3545; }

/* ===== BARRA DE FILTROS ===== */
.filtros-bar {
    background: var(--bg-white);
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.filtros-form {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.filtro-grupo {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 160px;
}

.filtro-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filtros-form .form-select {
    font-size: 0.8rem;
    padding: 0.4rem 2rem 0.4rem 0.75rem;
    border-color: var(--border-color);
}

/* ===== GRID SEMANAL ===== */
.semana-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    flex: 1;
    min-height: 0;
}

/* ===== COLUMNA DE DÍA ===== */
.dia-columna {
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.2s;
}

.dia-columna:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dia-columna.dia-hoy {
    box-shadow: 0 0 0 2px var(--macrogram-orange), 0 4px 12px rgba(245, 124, 0, 0.15);
}

.dia-columna.dia-pasado {
    opacity: 0.7;
}

.dia-columna.dia-pasado .dia-header {
    background: #e9ecef;
}

/* ===== HEADER DEL DÍA ===== */
.dia-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.dia-nombre {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.dia-numero {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.dia-numero.hoy-badge {
    background: var(--macrogram-orange);
    color: #fff;
}

.dia-contador {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--siryc-primary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* ===== CONTENIDO DEL DÍA ===== */
.dia-contenido {
    flex: 1;
    padding: 0.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ===== CARD DE MANTENIMIENTO ===== */
.mant-card {
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid var(--estado-color, #9E9E9E);
    padding: 0.625rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: all 0.2s;
    cursor: pointer;
}

.mant-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.mant-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.375rem;
}

.mant-centro {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mant-estado-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--estado-color, #9E9E9E);
    flex-shrink: 0;
}

.mant-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mant-fechas {
    font-size: 0.7rem;
    color: var(--siryc-primary);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--siryc-primary-light);
    background: rgba(26, 58, 92, 0.08);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.25rem;
}

.mant-fechas i {
    font-size: 0.6rem;
}

.mant-tecnico {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.7rem;
    color: var(--text-dark);
}

.mant-tecnico.sin-asignar {
    color: var(--text-muted);
    font-style: italic;
}

.tecnico-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--siryc-primary-light);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tecnico-nombre {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mant-card-footer {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f0f0f0;
}

.btn-ver, .btn-accion {
    flex: 1;
    padding: 0.25rem;
    border: none;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-ver {
    background: var(--bg-light);
    color: var(--text-dark);
}

.btn-ver:hover {
    background: var(--siryc-primary);
    color: #fff;
}

.btn-accion {
    background: transparent;
    color: var(--text-muted);
}

.btn-accion:hover {
    background: var(--bg-light);
    color: var(--macrogram-orange);
}

/* ===== ESTADO VACÍO ===== */
.dia-vacio {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    padding: 1rem;
    text-align: center;
}

.dia-vacio i {
    font-size: 1.5rem;
    opacity: 0.3;
    margin-bottom: 0.5rem;
}

.dia-vacio span {
    font-size: 0.7rem;
}

/* ===== BOTÓN AGREGAR ===== */
.dia-agregar {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--siryc-primary);
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(26, 58, 92, 0.3);
}

.dia-columna:hover .dia-agregar {
    opacity: 1;
    transform: scale(1);
}

.dia-agregar:hover {
    background: var(--macrogram-orange);
    transform: scale(1.1);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .semana-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 991px) {
    .calendario-container {
        height: auto;
    }

    .semana-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .dia-columna {
        min-height: 200px;
    }
}

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

    .stats-bar {
        gap: 1rem;
        justify-content: space-between;
    }

    .filtros-form {
        flex-direction: column;
        align-items: stretch;
    }

    .filtro-grupo {
        min-width: 100%;
    }

    .semana-navegacion {
        flex-wrap: wrap;
        justify-content: center;
    }

    .semana-actual {
        order: -1;
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* ===== SCROLLBAR PERSONALIZADO ===== */
.dia-contenido::-webkit-scrollbar {
    width: 4px;
}

.dia-contenido::-webkit-scrollbar-track {
    background: transparent;
}

.dia-contenido::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.dia-contenido::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
