/**
 * Estilos para Calendario Visual de Vacaciones
 */

.calendario-vacaciones {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

/* Header del calendario */
.calendario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.calendario-titulo {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.calendario-nav-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: #495057;
    font-size: 0.9rem;
}

.calendario-nav-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.calendario-nav-btn:active {
    transform: scale(0.95);
}

/* Mensaje de ayuda */
.calendario-ayuda {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #e7f3ff;
    border: 1px solid #0d6efd;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: #084298;
    animation: slideIn 0.3s ease-out;
}

.calendario-ayuda i {
    font-size: 1rem;
}

.calendario-ayuda span {
    flex: 1;
    font-weight: 500;
}

.calendario-ayuda-success {
    background: #d1e7dd;
    border-color: #0f5132;
    color: #0f5132;
}

.btn-limpiar {
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.75rem;
    color: inherit;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-limpiar:hover {
    background: rgba(0, 0, 0, 0.1);
}

.btn-limpiar i {
    font-size: 0.7rem;
    margin-right: 4px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Días de la semana */
.calendario-dias-semana {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendario-dia-semana {
    text-align: center;
    font-weight: 600;
    color: #6c757d;
    font-size: 0.75rem;
    padding: 4px 0;
}

/* Grid de días */
.calendario-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 15px;
}

.calendario-dia {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    position: relative;
    font-weight: 500;
}

.calendario-dia-numero {
    font-size: 0.85rem;
}

/* Estados de días */
.calendario-dia-vacio {
    pointer-events: none;
    background: transparent;
}

.calendario-dia-pasado {
    background: #f8f9fa;
    color: #adb5bd;
    cursor: not-allowed;
}

.calendario-dia-disponible {
    background: white;
    border-color: #dee2e6;
    color: #333;
}

.calendario-dia-disponible:hover {
    background: #e7f3ff;
    border-color: #0d6efd;
    transform: scale(1.05);
}

.calendario-dia-fin-semana {
    background: #f8f9fa;
    color: #6c757d;
}

.calendario-dia-fin-semana:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.calendario-dia-festivo {
    background: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}

.calendario-dia-festivo:hover {
    background: #ffe69c;
}

.calendario-dia-festivo::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: #ffc107;
    border-radius: 50%;
}

.calendario-dia-ocupado {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
    cursor: not-allowed;
    opacity: 0.7;
}

.calendario-dia-seleccionado {
    background: #0d6efd !important;
    color: white !important;
    border-color: #0d6efd !important;
}

.calendario-dia-seleccionado.calendario-dia-inicio {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.calendario-dia-seleccionado.calendario-dia-fin {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.calendario-dia-seleccionado.calendario-dia-festivo {
    background: linear-gradient(135deg, #0d6efd 0%, #0d6efd 50%, #ffc107 50%, #ffc107 100%) !important;
}

/* Preview */
.calendario-preview {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    min-height: 110px;
}

.preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 10px;
    color: #6c757d;
}

.preview-loading i {
    display: none;
}
.preview-loading span {
    margin: 0;
    font-weight: 600;
    color: #475569;
}

.preview-success {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #495057;
}

.preview-header i {
    color: #0d6efd;
    font-size: 1.25rem;
}

.preview-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.preview-stats {
    display: grid;
    gap: 12px;
    margin-bottom: 15px;
}

.preview-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #dee2e6;
}

.preview-stat-label {
    font-size: 0.9rem;
    color: #6c757d;
}

.preview-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

.preview-stat-highlight {
    border-left-color: #0d6efd;
    background: #e7f3ff;
}

.preview-stat-highlight .preview-stat-value {
    color: #0d6efd;
    font-size: 1.5rem;
}

.preview-stat-info {
    border-left-color: #ffc107;
}

.preview-stat-error {
    border-left-color: #dc3545;
    background: #f8d7da;
}

.preview-stat-error .preview-stat-value {
    color: #dc3545;
}

.preview-tipo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #6c757d;
}

.preview-tipo i {
    color: #0d6efd;
}

.preview-tipo strong {
    color: #333;
}

.preview-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    border-radius: 8px;
    color: #721c24;
    margin-top: 15px;
}

.preview-error i {
    font-size: 1.25rem;
}

/* Leyenda */
.calendario-leyenda {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
}

.leyenda-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #6c757d;
}

.leyenda-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #dee2e6;
}

.leyenda-disponible {
    background: white;
}

.leyenda-festivo {
    background: #fff3cd;
    border-color: #ffc107;
}

.leyenda-fin-semana {
    background: #f8f9fa;
}

.leyenda-seleccionado {
    background: #0d6efd;
    border-color: #0d6efd;
}

.leyenda-ocupado {
    background: #f8d7da;
    border-color: #f5c6cb;
}

/* Responsive */
@media (max-width: 768px) {
    .calendario-vacaciones {
        padding: 15px;
    }

    .calendario-titulo {
        font-size: 1.1rem;
    }

    .calendario-grid {
        gap: 4px;
    }

    .calendario-dia {
        border-width: 1px;
    }

    .calendario-dia-numero {
        font-size: 0.85rem;
    }

    .preview-stats {
        gap: 8px;
    }

    .preview-stat {
        padding: 10px 12px;
    }

    .calendario-leyenda {
        gap: 10px;
    }

    .leyenda-item {
        font-size: 0.75rem;
    }

    .leyenda-color {
        width: 16px;
        height: 16px;
    }
}

/* Animaciones adicionales */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.calendario-dia-seleccionado {
    animation: pulse 0.3s ease-in-out;
}

/* Spinner */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Indicador de carga */
.calendario-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: #495057;
    z-index: 10;
}

.calendario-loading i {
    font-size: 1.2rem;
    color: #0d6efd;
}
