/* OVT Tasación - Estilos Frontend */

.ovt-tasacion-custom-fields {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin: 25px 0;
}

.tasacion-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
}

.tasacion-subtitle {
    color: #666;
    font-size: 14px;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.tasacion-field-group {
    margin-bottom: 20px;
}

.tasacion-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 15px;
}

.tasacion-label .required {
    color: #e74c3c;
    font-weight: bold;
}

.tasacion-helper {
    font-size: 13px;
    color: #777;
    margin: 5px 0 10px 0;
    line-height: 1.4;
}

/* Campos de entrada */
.tasacion-input,
.tasacion-textarea,
.tasacion-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.tasacion-input:focus,
.tasacion-textarea:focus,
.tasacion-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.tasacion-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Upload de archivos */
.tasacion-upload-wrapper {
    position: relative;
}

.tasacion-file-input {
    position: absolute;
    opacity: 0;
    width: 0.1px;
    height: 0.1px;
}

.tasacion-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.tasacion-upload-label:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.tasacion-upload-label .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #999;
    margin-bottom: 10px;
}

.tasacion-upload-label .upload-text {
    color: #666;
    font-size: 14px;
}

/* Preview de imágenes */
.tasacion-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.tasacion-preview-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.tasacion-preview-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.tasacion-preview-item .preview-info {
    padding: 8px;
    font-size: 11px;
    color: #666;
    text-align: center;
    background: #f9f9f9;
    border-top: 1px solid #eee;
}

.tasacion-preview-item .remove-preview {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s ease;
}

.tasacion-preview-item .remove-preview:hover {
    background: rgba(192, 57, 43, 1);
}

/* Info box */
.tasacion-info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: #e8f4f8;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
    margin-top: 20px;
}

.tasacion-info-box.premium {
    background: #fff8e1;
    border-left-color: #d4af37;
}

.tasacion-info-box .dashicons {
    color: #0073aa;
    font-size: 24px;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.tasacion-info-box.premium .dashicons {
    color: #d4af37;
}

.tasacion-info-box p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #555;
}

/* Responsive */
@media (max-width: 768px) {
    .ovt-tasacion-custom-fields {
        padding: 20px 15px;
    }
    
    .tasacion-title {
        font-size: 18px;
    }
    
    .tasacion-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .tasacion-preview-item img {
        height: 100px;
    }
}

/* Estados de carga */
.tasacion-upload-wrapper.uploading .tasacion-upload-label {
    opacity: 0.6;
    pointer-events: none;
}

.tasacion-upload-wrapper.uploading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Mensajes de error */
.tasacion-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 5px;
    display: none;
}

.tasacion-field-group.has-error .tasacion-input,
.tasacion-field-group.has-error .tasacion-textarea,
.tasacion-field-group.has-error .tasacion-select {
    border-color: #e74c3c;
}

.tasacion-field-group.has-error .tasacion-error {
    display: block;
}
