/**
 * Estilos para el Duplicador de Tipologías
 */

/* Modal grande */
.modal-large .modal-content {
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    max-height: 800px;
}

.modal-large .modal-body {
    max-height: calc(90vh - 200px);
    overflow-y: auto;
}

/* Botones de header */
.panel-header .header-buttons {
    display: flex;
    gap: 8px;
}

.btn-duplicate {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-duplicate:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

/* Pasos del duplicador */
.duplicador-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 0 20px;
    position: relative;
}

.duplicador-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 80px;
    right: 80px;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.duplicador-steps .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.duplicador-steps .step .step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.3s ease;
}

.duplicador-steps .step.active .step-number {
    background: #2196F3;
    color: white;
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.2);
}

.duplicador-steps .step.completed .step-number {
    background: #4CAF50;
    color: white;
}

.duplicador-steps .step.completed .step-number::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.duplicador-steps .step .step-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.duplicador-steps .step.active .step-label {
    color: #2196F3;
    font-weight: 600;
}

/* Contenido de pasos */
.duplicador-step-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.duplicador-step-content.active {
    display: block;
}

.duplicador-step-content h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.duplicador-step-content .step-description {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

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

/* Form groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    display: block;
}

/* Info boxes */
.info-box {
    background: #f5f5f5;
    border-left: 4px solid #2196F3;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
}

.info-box h5 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    font-size: 14px;
}

.info-grid div {
    display: flex;
    gap: 8px;
}

.info-grid strong {
    color: #666;
    min-width: 100px;
}

/* Plantillas grid */
.plantillas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.plantilla-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.plantilla-card:hover {
    border-color: #2196F3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.plantilla-card.selected {
    border-color: #4CAF50;
    background: #f1f8f4;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.plantilla-icon {
    font-size: 48px;
    color: #2196F3;
    margin-bottom: 10px;
}

.plantilla-card.selected .plantilla-icon {
    color: #4CAF50;
}

.plantilla-card h4 {
    margin: 10px 0;
    font-size: 16px;
    color: #333;
}

.plantilla-card p {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.plantilla-card .badge {
    display: inline-block;
    background: #FF9800;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin-top: 8px;
}

/* Componentes mapping */
.componentes-mapping {
    max-height: 400px;
    overflow-y: auto;
}

.mapping-row {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    gap: 15px;
    align-items: center;
    padding: 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 10px;
}

.mapping-origen,
.mapping-destino {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mapping-origen strong,
.mapping-destino strong {
    color: #333;
    font-size: 14px;
}

.mapping-origen small {
    color: #999;
    font-size: 12px;
}

.mapping-arrow {
    text-align: center;
    color: #2196F3;
    font-size: 20px;
}

/* Revisión grid */
.revision-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.revision-section {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.revision-section.full-width {
    grid-column: 1 / -1;
}

.revision-section h5 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.resumen-item {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.resumen-item:last-child {
    border-bottom: none;
}

.resumen-item strong {
    color: #666;
    margin-right: 8px;
}

/* Validación */
.validation-success {
    background: #E8F5E9;
    color: #2E7D32;
    padding: 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.validation-errors {
    font-size: 13px;
}

.validation-errors h6 {
    margin: 10px 0 8px 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}

.validation-errors ul {
    margin: 0;
    padding-left: 20px;
}

.validation-errors li {
    margin-bottom: 6px;
    color: #666;
}

/* JSON Preview */
.json-preview {
    width: 100%;
    height: 300px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f8f8;
    resize: vertical;
}

/* Modal footer buttons */
.modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.btn-secondary,
.btn-primary,
.btn-success,
.btn-cancel {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary {
    background: #9E9E9E;
    color: white;
}

.btn-secondary:hover {
    background: #757575;
}

.btn-primary {
    background: #2196F3;
    color: white;
}

.btn-primary:hover {
    background: #1976D2;
}

.btn-success {
    background: #4CAF50;
    color: white;
}

.btn-success:hover {
    background: #45a049;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

/* Info notice */
.info-notice {
    background: #E3F2FD;
    border-left: 4px solid #2196F3;
    padding: 12px;
    border-radius: 4px;
    margin-top: 15px;
    display: flex;
    gap: 10px;
    font-size: 14px;
}

.info-notice i {
    color: #2196F3;
    font-size: 18px;
}

.info-notice strong {
    display: block;
    margin-bottom: 4px;
}

.info-notice small {
    color: #555;
    line-height: 1.4;
}

/* Modal Accesorio */
.calculo-config {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    margin-top: 10px;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    border-left: 4px solid #4CAF50;
}

.toast-success i {
    color: #4CAF50;
}

.toast-error {
    border-left: 4px solid #F44336;
}

.toast-error i {
    color: #F44336;
}

.toast-warning {
    border-left: 4px solid #FF9800;
}

.toast-warning i {
    color: #FF9800;
}

.toast-info {
    border-left: 4px solid #2196F3;
}

.toast-info i {
    color: #2196F3;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.loading i {
    font-size: 24px;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-large .modal-content {
        width: 95%;
        height: 95vh;
    }

    .duplicador-steps {
        padding: 0 10px;
    }

    .duplicador-steps .step .step-label {
        font-size: 10px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .plantillas-grid {
        grid-template-columns: 1fr;
    }

    .mapping-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .mapping-arrow {
        transform: rotate(90deg);
    }

    .revision-grid {
        grid-template-columns: 1fr;
    }
}
