/* Estado badges */
.estado-badge {
    @apply inline-flex px-2 py-1 text-xs font-medium rounded-full;
}

.estado-pendiente {
    @apply bg-yellow-100 text-yellow-800;
}

.estado-contactado {
    @apply bg-orange-100 text-orange-800;
}

.estado-en-curso {
    @apply bg-indigo-100 text-indigo-800;
}

.estado-integrado {
    @apply bg-green-100 text-green-800;
}

.estado-inactivo {
    @apply bg-red-100 text-red-800;
}

/* Tarjetas de programa */
.programa-card {
    @apply bg-white rounded-lg border border-gray-200 p-4 hover:shadow-md transition-shadow duration-200;
}

.programa-tag {
    @apply inline-flex items-center px-2 py-1 rounded-full text-xs font-medium;
}

.tag-curso {
    @apply bg-blue-100 text-blue-800;
}

.tag-estudio {
    @apply bg-green-100 text-green-800;
}

.tag-grupo {
    @apply bg-purple-100 text-purple-800;
}

.tag-sociedad {
    @apply bg-orange-100 text-orange-800;
}

/* Timeline de seguimiento */
.timeline-item {
    @apply relative pl-8 pb-8;
}

.timeline-item:last-child {
    @apply pb-0;
}

.timeline-item::before {
    content: '';
    @apply absolute left-3 top-1 w-2 h-2 bg-blue-500 rounded-full;
}

.timeline-item::after {
    content: '';
    @apply absolute left-3.5 top-1 h-full w-0.5 bg-gray-300;
}

.timeline-item:last-child::after {
    @apply hidden;
}

/* Modal responsive */
@media (max-width: 640px) {
    .modal-container {
        @apply mx-2;
    }
    
    .tabla-responsive {
        @apply block overflow-x-auto;
    }
}

/* Animaciones */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* CSS SEGUIMIENTO */
/* ============================================
   ESTILOS PARA VISTA PREVIA DE EMAIL
   ============================================ */

/* Contenedor principal de vista previa */
#vistaPreviaEmail {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    max-height: 400px;
    background: #f9fafb;
    height: 300px;
    overflow-y: scroll;
}

/* Encabezado del email */
.email-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 1.5rem;
    text-align: center;
}

.email-header h4 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.email-header p {
    opacity: 0.9;
    font-size: 0.875rem;
}

/* Cuerpo del email */
.email-body {
    padding: 1.5rem;
    background: white;
}

/* Saludo */
.email-saludo {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

/* Secciones destacadas */
.email-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 0.375rem;
    border-left: 4px solid;
}

.email-section h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.email-section.programas {
    background-color: #eff6ff;
    border-left-color: #3b82f6;
}

.email-section.programas h5 {
    color: #1e40af;
}

.email-section.programas ul {
    list-style-type: none;
    padding-left: 0;
}

.email-section.programas li {
    padding: 0.375rem 0;
    color: #1e40af;
    display: flex;
    align-items: center;
}

.email-section.programas li:before {
    content: "✓";
    color: #10b981;
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Pasos importantes */
.email-highlight {
    background: linear-gradient(to right, #fef3c7, #fde68a);
    border: 1px solid #fbbf24;
    padding: 1.25rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.email-highlight h5 {
    color: #92400e;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.email-highlight ul {
    list-style-type: none;
    padding-left: 0;
    color: #92400e;
}

.email-highlight li {
    padding: 0.25rem 0;
    display: flex;
    align-items: center;
}

.email-highlight li:before {
    content: "→";
    margin-right: 0.5rem;
    font-weight: bold;
}

/* Información de contacto */
.email-contacto {
    background: #f0f9ff;
    padding: 1rem;
    border-radius: 0.375rem;
    border-left: 4px solid #0ea5e9;
    margin: 1.5rem 0;
}

.email-contacto p {
    color: #0369a1;
    margin: 0.25rem 0;
}

/* Botones de acción */
.email-buttons {
    text-align: center;
    margin: 1.5rem 0;
}

.email-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    text-decoration: none;
    font-weight: 500;
    margin: 0 0.5rem;
    transition: all 0.2s;
}

.email-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.email-btn.secondary {
    background: #10b981;
    color: white;
}

.email-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Cita bíblica */
.email-bible {
    font-style: italic;
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    color: #4b5563;
    font-size: 0.875rem;
    background: #f9fafb;
}

.email-bible strong {
    color: #374151;
    font-weight: 600;
}

/* Pie de email */
.email-footer {
    text-align: center;
    padding: 1.5rem;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

/* Responsive */
@media (max-width: 640px) {
    .email-header {
        padding: 1.5rem 1rem;
    }
    
    .email-header h4 {
        font-size: 1.25rem;
    }
    
    .email-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .email-btn {
        margin: 0;
        width: 100%;
    }
}

/* Mejorar la legibilidad del texto */
.email-preview-container {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #374151;
}

/* Estilos para los iconos */
.email-preview-container i {
    vertical-align: middle;
}

/* Sombras y efectos */
.email-preview-container {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.email-preview-container:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Estilos para listas */
.email-preview-container ul {
    padding-left: 1.5rem;
}

.email-preview-container li {
    margin-bottom: 0.5rem;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .email-preview-container {
        margin: 0 -1rem;
        border-radius: 0;
    }
    
    .email-header {
        padding: 2rem 1rem !important;
    }
    
    .email-body {
        padding: 1.5rem !important;
    }
}

/* Estilos específicos para SMS y Llamada */
#formularioSMS textarea,
#formularioLlamada textarea {
    min-height: 100px;
    resize: vertical;
}

/* Contador de caracteres */
#contadorSMS.text-red-600 {
    font-weight: bold;
}

/* Deshabilitar opciones sin teléfono */
.opacity-50.cursor-not-allowed {
    pointer-events: none;
}

.opacity-50.cursor-not-allowed:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Estilos para sugerencias */
.sugerencia-item {
    background: #f8fafc;
    border-left: 3px solid #3b82f6;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.sugerencia-item:hover {
    background: #eff6ff;
    transform: translateX(2px);
}

/* Alertas informativas */
.info-alert {
    border-left: 4px solid;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}

/* Responsive para formularios */
@media (max-width: 640px) {
    #formularioLlamada .grid {
        grid-template-columns: 1fr !important;
    }
    
    .email-buttons .flex {
        flex-direction: column;
    }
    
    .email-buttons a {
        margin-bottom: 0.5rem;
        width: 100%;
        text-align: center;
    }
}


/* Estilos para la integración de llamadas */
.btn-llamada-rapida {
    position: relative;
    transition: all 0.2s ease;
}

.btn-llamada-rapida:hover {
    transform: scale(1.1);
}

.btn-llamada-rapida:hover:after {
    content: 'Programar llamada';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
}

/* Modal de llamada rápida */
#modalLlamadaRapida .bg-white {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Integración visual */
.modal-integracion {
    border-top: 4px solid #3b82f6;
}

.modal-integracion .header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}


/* Estilos para el modal de detalles */
.modal-detalle-contenido {
    max-height: calc(90vh - 200px);
    overflow-y: auto;
}

.modal-detalle-contenido::-webkit-scrollbar {
    width: 8px;
}

.modal-detalle-contenido::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-detalle-contenido::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

/* Estilos para las secciones */
.detalle-seccion {
    transition: all 0.3s ease;
}

.detalle-seccion:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Estilos para las tablas */
.detalle-tabla {
    font-size: 0.875rem;
}

.detalle-tabla th {
    font-weight: 600;
    color: #4b5563;
}

.detalle-tabla tr:hover {
    background-color: #f9fafb;
}

/* Estilos para los badges */
.badge-estado {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-detalle-contenido .grid {
        grid-template-columns: 1fr !important;
    }
    
    .detalle-tabla {
        font-size: 0.75rem;
    }
    
    .detalle-tabla th,
    .detalle-tabla td {
        padding: 0.5rem;
    }
}

/* Estilos para el historial */
.historial-item {
    transition: all 0.2s ease;
    border-left-width: 4px;
}

.historial-item:hover {
    background-color: #f8fafc;
    transform: translateX(2px);
}

.historial-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.historial-content {
    flex: 1;
    min-width: 0; /* Para evitar desbordamientos */
}

.historial-date {
    font-size: 0.75rem;
    white-space: nowrap;
}

.historial-user {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Badges de estado en historial */
.historial-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    display: inline-block;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Scrollbar personalizado para historial */
.historial-scroll {
    max-height: 400px;
    overflow-y: auto;
}

.historial-scroll::-webkit-scrollbar {
    width: 6px;
}

.historial-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.historial-scroll::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.historial-scroll::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Animaciones */
@keyframes fadeInHistorial {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.historial-item {
    animation: fadeInHistorial 0.3s ease-out;
}

/* Ordenar por fecha */
.historial-item:nth-child(1) { animation-delay: 0.1s; }
.historial-item:nth-child(2) { animation-delay: 0.2s; }
.historial-item:nth-child(3) { animation-delay: 0.3s; }
.historial-item:nth-child(4) { animation-delay: 0.4s; }
.historial-item:nth-child(5) { animation-delay: 0.5s; }