/* Estilos específicos para la interfaz de envío masivo de emails */

/* Tarjetas de tipo de email mejoradas */
.email-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.email-type-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: white;
    position: relative;
    overflow: hidden;
}

.email-type-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ddff19, #2d164c);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.email-type-card:hover {
    border-color: #2d164c;
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(45, 22, 76, 0.15);
}

.email-type-card:hover::before {
    transform: scaleX(1);
}

.email-type-card.selected {
    border-color: #2d164c;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    box-shadow: 0 8px 16px rgba(45, 22, 76, 0.1);
}

.email-type-card.selected::before {
    transform: scaleX(1);
}

.email-type-card .icon {
    font-size: 32px;
    margin-bottom: 15px;
    display: inline-block;
    padding: 12px;
    background: linear-gradient(135deg, #2d164c 0%, #062156 100%);
    color: white;
    border-radius: 10px;
    width: 56px;
    height: 56px;
    text-align: center;
    line-height: 32px;
}

.email-type-card h3 {
    margin-top: 0;
    color: #2d164c;
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.email-type-card p {
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* Selección de clientes mejorada */
.clients-selection {
    max-height: 400px;
    overflow-y: auto;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin: 25px 0;
    background: white;
}

.client-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.client-checkbox:hover {
    background-color: #f8f9ff;
    border-color: #e0e0e0;
    transform: translateX(5px);
}

.client-checkbox input[type="checkbox"] {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #2d164c;
}

.client-info {
    flex: 1;
}

.client-name {
    font-weight: 600;
    color: #2d164c;
    font-size: 1.1rem;
}

.client-email {
    font-size: 13px;
    color: #666;
    margin-top: 3px;
}

.selection-actions {
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

#selected-count {
    font-weight: 600;
    color: #2d164c;
    background: #f0f2ff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Vista previa de plantilla mejorada */
.template-preview {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    background: white;
    position: relative;
}

.template-preview::before {
    content: 'Vista Previa';
    position: absolute;
    top: -12px;
    left: 20px;
    background: white;
    padding: 0 10px;
    color: #2d164c;
    font-weight: 600;
    font-size: 0.9rem;
}

.template-preview h4 {
    color: #2d164c;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

#template-preview-content {
    min-height: 100px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 8px;
    border: 1px dashed #cce5ff;
}

.template-placeholder {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 40px 20px;
}

/* Botones especiales para email */
.btn-email {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
}

.btn-email .btn-icon {
    font-size: 1.2rem;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

/* Formulario de envío masivo */
.email-mass-form {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.form-section {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 2px solid #f0f2ff;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h2 {
    color: #2d164c;
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h2::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #ddff19;
    border-radius: 50%;
}

/* Campos de formulario mejorados */
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d164c;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2d164c;
    box-shadow: 0 0 0 3px rgba(45, 22, 76, 0.1);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* Resultados de envío */
.results-summary {
    margin: 25px 0;
    padding: 20px;
    border-radius: 10px;
    background-color: #f8f9fa;
    border: 2px solid transparent;
}

.results-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.results-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.results-summary h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* Indicador de progreso */
.progress-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 30px 0;
    position: relative;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.progress-step .step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    background: linear-gradient(135deg, #2d164c 0%, #062156 100%);
    color: white;
    transform: scale(1.1);
}

.progress-step.completed .step-number {
    background: #ddff19;
    color: #2d164c;
}

.progress-step .step-label {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

.progress-step.active .step-label {
    color: #2d164c;
    font-weight: 600;
}

.progress-indicator::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 3px;
    background: #e0e0e0;
    z-index: 1;
}

/* Notas y ayuda */
.form-note {
    background: #f0f7ff;
    border-left: 4px solid #2d164c;
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
    margin: 20px 0;
}

.form-note p {
    margin: 0;
    color: #2d164c;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
    .email-types {
        grid-template-columns: 1fr;
    }
    
    .email-type-card {
        padding: 20px;
    }
    
    .selection-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .client-checkbox {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .client-checkbox input[type="checkbox"] {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .progress-indicator {
        flex-direction: column;
        gap: 20px;
    }
    
    .progress-indicator::before {
        display: none;
    }
    
    .email-mass-form {
        padding: 20px 15px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.email-type-card,
.client-checkbox,
.form-section {
    animation: fadeIn 0.5s ease forwards;
}

.email-type-card:nth-child(1) { animation-delay: 0.1s; }
.email-type-card:nth-child(2) { animation-delay: 0.2s; }
.email-type-card:nth-child(3) { animation-delay: 0.3s; }
.email-type-card:nth-child(4) { animation-delay: 0.4s; }

/* Efectos de carga */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #2d164c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}